]> granicus.if.org Git - python/commitdiff
#15872: Be flexible with appending *.* in shutil.rmtree test case
authorHynek Schlawack <hs@ox.cx>
Mon, 10 Dec 2012 11:02:26 +0000 (12:02 +0100)
committerHynek Schlawack <hs@ox.cx>
Mon, 10 Dec 2012 11:02:26 +0000 (12:02 +0100)
The Windows buildbots seem to be unable to agree whether they need them or not.

1  2 
Lib/test/test_shutil.py

index 92ab0a4150a3bda415a66dc08abd09c9b12f0dd5,9509d2a69f961cd7253aae12289e8b26bd434dc5..e0ecbf7601d459384c1e909f3113aaf16ce89018
@@@ -167,11 -128,11 +167,11 @@@ class TestShutil(unittest.TestCase)
  
          # existing file
          tmpdir = self.mkdtemp()
 -        self.write_file((tmpdir, "tstfile"), "")
 +        write_file((tmpdir, "tstfile"), "")
          filename = os.path.join(tmpdir, "tstfile")
 -        with self.assertRaises(OSError) as cm:
 +        with self.assertRaises(NotADirectoryError) as cm:
              shutil.rmtree(filename)
-         if os.name == 'nt':
+         if cm.exception.filename.endswith('*.*'):
              rm_name = os.path.join(filename, '*.*')
          else:
              rm_name = filename