From: Guido van Rossum Date: Fri, 15 Aug 1997 16:23:32 +0000 (+0000) Subject: Use imp.find_module() as the most certain way to find the test data. X-Git-Tag: v1.5a3~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c95a6c1af5cdbba38ccc7eb9398df01bc24dd731;p=thirdparty%2FPython%2Fcpython.git Use imp.find_module() as the most certain way to find the test data. --- diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py index 79eb8772a74d..2e93480b21c0 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)