From 629bcfb8f907cf25bcdadb6a3af5f154fc0d5550 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 18 Dec 1997 05:21:07 +0000 Subject: Make this test succeed even when using "import test.test_zlib". --- Lib/test/test_zlib.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py index 62c2604..72dbcfa 100644 --- a/Lib/test/test_zlib.py +++ b/Lib/test/test_zlib.py @@ -3,8 +3,11 @@ import sys import imp import string -t = imp.find_module('test_zlib') -file = t[0] +try: + t = imp.find_module('test_zlib') + file = t[0] +except ImportError: + file = open(__file__) buf = file.read() * 8 file.close() -- cgit v0.12