From 0bd7b44ed5056dcc0033766f8c3f3308b69ef206 Mon Sep 17 00:00:00 2001 From: Roderik Ploszek Date: Mon, 19 Mar 2018 23:10:24 +0100 Subject: [PATCH] flake8 --- scripts/pygettext.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/pygettext.py b/scripts/pygettext.py index 6265759b..fba2e9ec 100755 --- a/scripts/pygettext.py +++ b/scripts/pygettext.py @@ -481,7 +481,8 @@ class TokenEater: timestamp = time.ctime(time.time()) # The time stamp in the header doesn't have the same format as that # generated by xgettext... - print(pot_header % {'time': timestamp, 'version': __version__}, file=fp) + print(pot_header % {'time': timestamp, 'version': __version__}, + file=fp) # Sort the entries. First sort each particular entry's keys, then # sort all the entries by their first item. reverse = {} @@ -512,8 +513,8 @@ class TokenEater: elif options.locationstyle == options.SOLARIS: for filename, lineno in v: d = {'filename': filename, 'lineno': lineno} - print(_( - '# File: %(filename)s, line: %(lineno)d') % d, file=fp) + print(_('# File: %(filename)s, line: %(lineno)d') % d, + file=fp) elif options.locationstyle == options.GNU: # fit as many locations on one line, as long as the # resulting line length doesn't exceeds 'options.width' @@ -652,8 +653,8 @@ def main(): options.toexclude = fp.readlines() fp.close() except IOError: - print(_( - "Can't read --exclude-file: %s") % options.excludefilename, file=sys.stderr) + print(_("Can't read --exclude-file: %s") % options.excludefilename, + file=sys.stderr) sys.exit(1) else: options.toexclude = [] @@ -688,7 +689,7 @@ def main(): except tokenize.TokenError as e: print('%s: %s, line %d, column %d' % ( e[0], filename, e[1][0], e[1][1]), file=sys.stderr) - except StopTokenizing: + except tokenize.StopTokenizing: pass finally: if closep: