Commit 304e542c authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #20056: Fixed deprecation warning about bytes path in test_shutil on

Windows.  Path by Vajrasky Kok.
parents dd50b0aa 41ad77c6
...@@ -10,6 +10,7 @@ import os.path ...@@ -10,6 +10,7 @@ import os.path
import errno import errno
import functools import functools
import subprocess import subprocess
from contextlib import ExitStack
from test import support from test import support
from test.support import TESTFN from test.support import TESTFN
from os.path import splitdrive from os.path import splitdrive
...@@ -122,7 +123,9 @@ class TestShutil(unittest.TestCase): ...@@ -122,7 +123,9 @@ class TestShutil(unittest.TestCase):
write_file(os.path.join(victim, 'somefile'), 'foo') write_file(os.path.join(victim, 'somefile'), 'foo')
victim = os.fsencode(victim) victim = os.fsencode(victim)
self.assertIsInstance(victim, bytes) self.assertIsInstance(victim, bytes)
shutil.rmtree(victim) win = (os.name == 'nt')
with self.assertWarns(DeprecationWarning) if win else ExitStack():
shutil.rmtree(victim)
@support.skip_unless_symlink @support.skip_unless_symlink
def test_rmtree_fails_on_symlink(self): def test_rmtree_fails_on_symlink(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment