summaryrefslogtreecommitdiffstats
path: root/test/leaky-handles.py
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2019-04-26 17:10:19 (GMT)
committerMats Wichmann <mats@linux.com>2019-04-26 19:11:59 (GMT)
commit15326cf04732bbcc5ef62c5452349a4bd029b70e (patch)
tree8a7f61381f13838164e43bcb533adf1e5efd93ee /test/leaky-handles.py
parent0e84c296d686e4384c8e6f5137a7c15e51dcb167 (diff)
downloadSCons-15326cf04732bbcc5ef62c5452349a4bd029b70e.zip
SCons-15326cf04732bbcc5ef62c5452349a4bd029b70e.tar.gz
SCons-15326cf04732bbcc5ef62c5452349a4bd029b70e.tar.bz2
[PR #3345] fix more PY3.8 fails
File closes in msvs tool Context manager in rpm tool Dummy compiler, assembler scripts can be called in unexpected ways (namely by gcc tool init), which passes --version flag. don't take exception on the getopt call. Try again to undo my breakage of _subproc, which was failing on Win+PY27 Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'test/leaky-handles.py')
-rw-r--r--test/leaky-handles.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/leaky-handles.py b/test/leaky-handles.py
index 3787ee2..e64053c 100644
--- a/test/leaky-handles.py
+++ b/test/leaky-handles.py
@@ -41,11 +41,10 @@ if os.name != 'posix' or sys.platform == 'darwin':
test.write('SConstruct', """
-#Leak a file handle
-open('/dev/null')
-
-#Check it gets closed
-test2 = Command('test2', [], '@ls /proc/$$$$/fd|wc -l')
+# Leave a file handle open when invoking a command
+with open('/dev/null'):
+ # Check it gets closed when an external command is forked off:
+ test2 = Command('test2', [], '@ls /proc/$$$$/fd|wc -l')
""")
# In theory that should have 3 lines (handles 0/1/2). This is v. unix specific