summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_zlib.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-08-15 16:23:32 (GMT)
committerGuido van Rossum <guido@python.org>1997-08-15 16:23:32 (GMT)
commitc95a6c1af5cdbba38ccc7eb9398df01bc24dd731 (patch)
treedd210e4a07b4a66090b773aca2ec96900b9dc4c9 /Lib/test/test_zlib.py
parent57fa217b0144706a605bb0927841aec505676671 (diff)
downloadcpython-c95a6c1af5cdbba38ccc7eb9398df01bc24dd731.zip
cpython-c95a6c1af5cdbba38ccc7eb9398df01bc24dd731.tar.gz
cpython-c95a6c1af5cdbba38ccc7eb9398df01bc24dd731.tar.bz2
Use imp.find_module() as the most certain way to find the test data.
Diffstat (limited to 'Lib/test/test_zlib.py')
-rw-r--r--Lib/test/test_zlib.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py
index 79eb877..2e93480 100644
--- a/Lib/test/test_zlib.py
+++ b/Lib/test/test_zlib.py
@@ -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)