summaryrefslogtreecommitdiff
path: root/tests/path.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/path.py')
-rw-r--r--tests/path.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/path.py b/tests/path.py
index 20deb0489..7b89c0cd3 100644
--- a/tests/path.py
+++ b/tests/path.py
@@ -64,8 +64,13 @@ except NameError:
# Universal newline support
_textmode = 'r'
-if hasattr(file, 'newlines'):
+try:
+ file
+except NameError:
_textmode = 'U'
+else:
+ if hasattr(file, 'newlines'):
+ _textmode = 'U'
class TreeWalkWarning(Warning):