diff options
| author | DasIch <dasdasich@gmail.com> | 2010-05-08 23:23:56 +0200 |
|---|---|---|
| committer | DasIch <dasdasich@gmail.com> | 2010-05-08 23:23:56 +0200 |
| commit | 3ab89e534d271f8e5ee030fd260da7f16bfcc007 (patch) | |
| tree | 88f43d92e0bc619ed89e0e9403887f0c38ab3afb | |
| parent | afa4efb7ab548205e24b74e0ada55ec5a27145c6 (diff) | |
| download | sphinx-3ab89e534d271f8e5ee030fd260da7f16bfcc007.tar.gz | |
Use 'U' if file is not present (we run under 3.x)
| -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 20deb048..7b89c0cd 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): |
