From cd3a213adb45eb736754db0a893e1b58c56995a7 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Tue, 23 Aug 2016 16:57:39 -0700 Subject: [PATCH] Fix issues detected by pycodestyle When doing a test using pycodestyle instead of pep8, a few errors were reported. Fix those errors so it passed the tests. Change-Id: I8e280aeab0575bd5a0919cbe4b9292df51c987ed --- hacking/checks/python23.py | 10 +++++----- releasenotes/source/conf.py | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/hacking/checks/python23.py b/hacking/checks/python23.py index 6c42c138..4315cab8 100644 --- a/hacking/checks/python23.py +++ b/hacking/checks/python23.py @@ -37,12 +37,12 @@ def hacking_python3x_except_compatible(logical_line, noqa): return def is_old_style_except(logical_line): - return (',' in logical_line - and ')' not in logical_line.rpartition(',')[2]) + return (',' in logical_line and + ')' not in logical_line.rpartition(',')[2]) - if (logical_line.startswith("except ") - and logical_line.endswith(':') - and is_old_style_except(logical_line)): + if (logical_line.startswith("except ") and + logical_line.endswith(':') and + is_old_style_except(logical_line)): yield 0, "H231: Python 3.x incompatible 'except x,y:' construct" diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index 2da6998d..830f5172 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +import pbr.version + # Hacking Release Notes documentation build configuration file, created by # sphinx-quickstart on Tue Nov 3 17:40:50 2015. # @@ -62,7 +64,6 @@ copyright = u'2015, Hacking Developers' # |version| and |release|, also used in various other places throughout the # built documents. -import pbr.version version_info = pbr.version.VersionInfo('hacking') # The short X.Y version. release = version_info.version_string_with_vcs()