Fix Travis Builds

This patch fixes the Travis builds which were broken due to new Flake8
versions which complained about previously accepted code.
This commit is contained in:
Lars Kiesow 2018-03-04 20:10:01 +01:00
parent 9026316391
commit dd15d63fbc
No known key found for this signature in database
GPG key ID: 5DAFE8D9C823CE73
2 changed files with 7 additions and 7 deletions

View file

@ -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

View file

@ -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)