summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ntpath.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-11-15 21:27:41 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-11-15 21:27:41 (GMT)
commit1ab6c2d2c2b6c78e492491542007edfb880889f0 (patch)
tree2933764c675aa8f715a176c7ae0cb8486bdd0f0a /Lib/test/test_ntpath.py
parent6166519d2bfb0b6fd7ff304da89c59b10557d4a3 (diff)
downloadcpython-1ab6c2d2c2b6c78e492491542007edfb880889f0.zip
cpython-1ab6c2d2c2b6c78e492491542007edfb880889f0.tar.gz
cpython-1ab6c2d2c2b6c78e492491542007edfb880889f0.tar.bz2
Issue #13374: The Windows bytes API has been deprecated in the os module. Use
Unicode filenames instead of bytes filenames to not depend on the ANSI code page anymore and to support any filename.
Diffstat (limited to 'Lib/test/test_ntpath.py')
-rw-r--r--Lib/test/test_ntpath.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py
index 6464950..2c9dab9 100644
--- a/Lib/test/test_ntpath.py
+++ b/Lib/test/test_ntpath.py
@@ -1,10 +1,11 @@
import ntpath
import os
import sys
+import unittest
+import warnings
from test.support import TestFailed
from test import support, test_genericpath
from tempfile import TemporaryFile
-import unittest
def tester(fn, wantResult):
@@ -21,7 +22,9 @@ def tester(fn, wantResult):
fn = fn.replace('["', '[b"')
fn = fn.replace(", '", ", b'")
fn = fn.replace(', "', ', b"')
- gotResult = eval(fn)
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", DeprecationWarning)
+ gotResult = eval(fn)
if isinstance(wantResult, str):
wantResult = wantResult.encode('ascii')
elif isinstance(wantResult, tuple):