]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Use imp.find_module() as the most certain way to find the test data.
authorGuido van Rossum <guido@python.org>
Fri, 15 Aug 1997 16:23:32 +0000 (16:23 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 15 Aug 1997 16:23:32 +0000 (16:23 +0000)
Lib/test/test_zlib.py

index 79eb8772a74de6294c074a93461b97447711094e..2e93480b21c0aeb08e99759735e9ff0ff4467d37 100644 (file)
@@ -1,7 +1,11 @@
 import zlib
 import sys
+import imp
 
-buf = open(sys.argv[0]).read() * 8
+t = imp.find_module('test_zlib')
+file = t[0]
+buf = file.read() * 8
+file.close()
 
 x = zlib.compress(buf)
 y = zlib.decompress(x)