diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-01-10 20:43:03 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-01-10 20:43:03 (GMT) |
commit | ee105dcc62fd4500d7e25a7c6679e274bc220bd7 (patch) | |
tree | 2de15151f4adae283d53e897c43c7db0b98bab8a /Lib/test/test_pydoc.py | |
parent | 664ebb03af421173ec0f127022efc73dca8ff812 (diff) | |
download | cpython-ee105dcc62fd4500d7e25a7c6679e274bc220bd7.zip cpython-ee105dcc62fd4500d7e25a7c6679e274bc220bd7.tar.gz cpython-ee105dcc62fd4500d7e25a7c6679e274bc220bd7.tar.bz2 |
Fixed test_tempfilepager in test_pydoc on Windows.
Filename such as r'c:\users\db3l\appdata\local\temp\tmph3vkvf' contains '\t'
which is interpreted by ast.literal_eval() as a tabulation.
Diffstat (limited to 'Lib/test/test_pydoc.py')
-rw-r--r-- | Lib/test/test_pydoc.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 61f52aa..5c62f68 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -473,8 +473,9 @@ class TestUnicode(unittest.TestCase): output = {} def mock_system(cmd): - import ast - output['content'] = open(ast.literal_eval(cmd.strip())).read() + filename = cmd.strip()[1:-1] + self.assertEqual('"' + filename + '"', cmd.strip()) + output['content'] = open(filename).read() saved, os.system = os.system, mock_system try: pydoc.tempfilepager(doc, '') |