There was an error while loading. Please reload this page.
1 parent 49754af commit 590fe02Copy full SHA for 590fe02
1 file changed
Lib/test/test_commands.py
@@ -27,14 +27,16 @@ def test_getoutput(self):
27
# we use mkdtemp in the next line to create an empty directory
28
# under our exclusive control; from that, we can invent a pathname
29
# that we _know_ won't exist. This is guaranteed to fail.
30
+ dir = None
31
try:
32
dir = tempfile.mkdtemp()
33
name = os.path.join(dir, "foo")
34
35
status, output = getstatusoutput('cat ' + name)
36
self.assertNotEquals(status, 0)
37
finally:
- os.rmdir(dir)
38
+ if dir is not None:
39
+ os.rmdir(dir)
40
41
def test_getstatus(self):
42
# This pattern should match 'ls -ld /.' on any posix
0 commit comments