]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Change the test data to ask for class C from module __main__ rather
authorGuido van Rossum <guido@python.org>
Mon, 16 Apr 2001 00:28:21 +0000 (00:28 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 16 Apr 2001 00:28:21 +0000 (00:28 +0000)
than from module pickletester.  Using the latter turned out to cause
the test to break when invoked as "import test.test_pickle" or "import
test.autotest".

Lib/test/pickletester.py

index 8014efe8c1c6614e1514efa75f3dd0b857a2ddf6..edef37c65b2a6301c41ebab3604f1b6bf6be66c6 100644 (file)
@@ -31,7 +31,7 @@ a""" + \
 p4
 g4
 """ + \
-"""(ipickletester
+"""(i__main__
 C
 p5
 """ + \
@@ -54,7 +54,7 @@ BINDATA = ']q\x01(K\x00L1L\nG@\x00\x00\x00\x00\x00\x00\x00' + \
           '\x00G\x00\x00\x00\x00\x00\x00\x00\x00tRq\x03K\x01J\xff\xff' + \
           '\xff\xffK\xffJ\x01\xff\xff\xffJ\x00\xff\xff\xffM\xff\xff' + \
           'J\x01\x00\xff\xffJ\x00\x00\xff\xffJ\xff\xff\xff\x7fJ\x01\x00' + \
-          '\x00\x80J\x00\x00\x00\x80(U\x03abcq\x04h\x04(cpickletester\n' + \
+          '\x00\x80J\x00\x00\x00\x80(U\x03abcq\x04h\x04(c__main__\n' + \
           'C\nq\x05oq\x06}q\x07(U\x03fooq\x08K\x01U\x03barq\tK\x02ubh' + \
           '\x06tq\nh\nK\x05e.'
 
@@ -64,6 +64,7 @@ class C:
 
 import __main__
 __main__.C = C
+C.__module__ = "__main__"
 
 # Call this with the module to be tested (pickle or cPickle).