diff options
author | Daniel Neuhäuser <ich@danielneuhaeuser.de> | 2010-05-08 23:23:56 +0200 |
---|---|---|
committer | Daniel Neuhäuser <ich@danielneuhaeuser.de> | 2010-05-08 23:23:56 +0200 |
commit | 28349ed8569665196b4b2363ac23e13a22006f72 (patch) | |
tree | 88f43d92e0bc619ed89e0e9403887f0c38ab3afb /tests/path.py | |
parent | d6e5dfacd48c2d8bdc92a30b9bbeb3c015a03f12 (diff) | |
download | sphinx-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.py | 7 |
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): |