From dd15d63fbc3698e28cea05e308bfa9dc69ce7fb9 Mon Sep 17 00:00:00 2001 From: Lars Kiesow Date: Sun, 4 Mar 2018 20:10:01 +0100 Subject: [PATCH] Fix Travis Builds This patch fixes the Travis builds which were broken due to new Flake8 versions which complained about previously accepted code. --- feedgen/util.py | 10 +++++----- tests/test_main.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/feedgen/util.py b/feedgen/util.py index e361651..ca4ad58 100644 --- a/feedgen/util.py +++ b/feedgen/util.py @@ -64,11 +64,11 @@ def ensure_format(val, allowed, required, allowed_values=None, defaults=None): return val -def formatRFC2822(d): +def formatRFC2822(date): '''Make sure the locale setting do not interfere with the time format. ''' - l = locale.setlocale(locale.LC_ALL) + old = locale.setlocale(locale.LC_ALL) locale.setlocale(locale.LC_ALL, 'C') - d = d.strftime('%a, %d %b %Y %H:%M:%S %z') - locale.setlocale(locale.LC_ALL, l) - return d + date = date.strftime('%a, %d %b %Y %H:%M:%S %z') + locale.setlocale(locale.LC_ALL, old) + return date diff --git a/tests/test_main.py b/tests/test_main.py index 7985289..efea777 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -27,7 +27,7 @@ class TestSequenceFunctions(unittest.TestCase): sys.argv = ['feedgen', ftype] try: __main__.main() - except: + except Exception: assert False def test_file(self): @@ -36,7 +36,7 @@ class TestSequenceFunctions(unittest.TestCase): sys.argv = ['feedgen', filename] try: __main__.main() - except: + except Exception: assert False os.close(fh) os.remove(filename)