diff options
author | Ronny Pfannschmidt <ronny.pfannschmidt@redhat.com> | 2016-09-08 10:03:45 +0200 |
---|---|---|
committer | Ronny Pfannschmidt <ronny.pfannschmidt@redhat.com> | 2016-09-08 10:03:45 +0200 |
commit | 1812387bf0c2cb36630afa3942f553c9540a5f47 (patch) | |
tree | 1b4fab1fbb5d9a3af0d96e78daa7533e86e1db58 /_pytest/compat.py | |
parent | 10094a3f091ab64a608bc5107e91cafc9faa0c4c (diff) | |
download | pytest-1812387bf0c2cb36630afa3942f553c9540a5f47.tar.gz |
Mark: fix python 3 compatibility
Diffstat (limited to '_pytest/compat.py')
-rw-r--r-- | _pytest/compat.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/_pytest/compat.py b/_pytest/compat.py index 1d8c2f331..d5f7ffe56 100644 --- a/_pytest/compat.py +++ b/_pytest/compat.py @@ -111,7 +111,7 @@ if sys.version_info[:2] == (2, 6): if _PY3: import codecs - + imap = map STRING_TYPES = bytes, str def _escape_strings(val): @@ -145,6 +145,8 @@ if _PY3: else: STRING_TYPES = bytes, str, unicode + from itertools import imap + def _escape_strings(val): """In py2 bytes and str are the same type, so return if it's a bytes object, return it unchanged if it is a full ascii string, @@ -213,4 +215,4 @@ def _is_unittest_unexpected_success_a_failure(): Changed in version 3.4: Returns False if there were any unexpectedSuccesses from tests marked with the expectedFailure() decorator. """ - return sys.version_info >= (3, 4)
\ No newline at end of file + return sys.version_info >= (3, 4) |