summaryrefslogtreecommitdiff
path: root/tests/path.py
diff options
context:
space:
mode:
authorDaniel Neuhäuser <ich@danielneuhaeuser.de>2010-05-08 23:23:56 +0200
committerDaniel Neuhäuser <ich@danielneuhaeuser.de>2010-05-08 23:23:56 +0200
commit28349ed8569665196b4b2363ac23e13a22006f72 (patch)
tree88f43d92e0bc619ed89e0e9403887f0c38ab3afb /tests/path.py
parentd6e5dfacd48c2d8bdc92a30b9bbeb3c015a03f12 (diff)
downloadsphinx-git-28349ed8569665196b4b2363ac23e13a22006f72.tar.gz
Use 'U' if file is not present (we run under 3.x)
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):