diff options
author | Cyril Roelandt <cyril.roelandt@enovance.com> | 2014-03-18 12:49:12 +0100 |
---|---|---|
committer | Cyril Roelandt <cyril.roelandt@enovance.com> | 2014-03-18 12:49:12 +0100 |
commit | 674ae7718bc06a8b8c8b658075bf82c8198fb632 (patch) | |
tree | 0075bace24ead7f03ae7cb18935e4c707f71a860 /tests/test_fileapp.py | |
parent | 3cdb7e4227cbaad690b1c1557c03fa6da0decc36 (diff) | |
download | paste-674ae7718bc06a8b8c8b658075bf82c8198fb632.tar.gz |
Python 3: use new names of standard library modules
Use "try/except ImportError" to try Python 2 and Python 3 names.
Diffstat (limited to 'tests/test_fileapp.py')
-rw-r--r-- | tests/test_fileapp.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/test_fileapp.py b/tests/test_fileapp.py index edb4e4c..c0013fb 100644 --- a/tests/test_fileapp.py +++ b/tests/test_fileapp.py @@ -1,10 +1,17 @@ # (c) 2005 Ian Bicking, Clark C. Evans and contributors # This module is part of the Python Paste Project and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php +import string +import time +try: + # Python 3 + from email.utils import parsedate_tz, mktime_tz +except ImportError: + # Python 2 + from rfc822 import parsedate_tz, mktime_tz + from paste.fileapp import * from paste.fixture import * -from rfc822 import parsedate_tz, mktime_tz -import time, string def test_data(): harness = TestApp(DataApp('mycontent')) |