Skip to content

Commit 42f92da

Browse files
committed
Change the test data to ask for class C from module __main__ rather
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".
1 parent 13324e1 commit 42f92da

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Lib/test/pickletester.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
p4
3232
g4
3333
""" + \
34-
"""(ipickletester
34+
"""(i__main__
3535
C
3636
p5
3737
""" + \
@@ -54,7 +54,7 @@
5454
'\x00G\x00\x00\x00\x00\x00\x00\x00\x00tRq\x03K\x01J\xff\xff' + \
5555
'\xff\xffK\xffJ\x01\xff\xff\xffJ\x00\xff\xff\xffM\xff\xff' + \
5656
'J\x01\x00\xff\xffJ\x00\x00\xff\xffJ\xff\xff\xff\x7fJ\x01\x00' + \
57-
'\x00\x80J\x00\x00\x00\x80(U\x03abcq\x04h\x04(cpickletester\n' + \
57+
'\x00\x80J\x00\x00\x00\x80(U\x03abcq\x04h\x04(c__main__\n' + \
5858
'C\nq\x05oq\x06}q\x07(U\x03fooq\x08K\x01U\x03barq\tK\x02ubh' + \
5959
'\x06tq\nh\nK\x05e.'
6060

@@ -64,6 +64,7 @@ def __cmp__(self, other):
6464

6565
import __main__
6666
__main__.C = C
67+
C.__module__ = "__main__"
6768

6869
# Call this with the module to be tested (pickle or cPickle).
6970

0 commit comments

Comments
 (0)