Apparently the code to forestall Tk eating events was too aggressive (Tk user input...
[python/dscho.git] / Lib / test / test_copy_reg.py
blob0324d92dcae5415cf3375781a33cca3f32b5e6e8
1 import copy_reg
3 class C:
4 pass
7 try:
8 copy_reg.pickle(C, None, None)
9 except TypeError, e:
10 print "Caught expected TypeError:"
11 print e
12 else:
13 print "Failed to catch expected TypeError when registering a class type."
16 print
17 try:
18 copy_reg.pickle(type(1), "not a callable")
19 except TypeError, e:
20 print "Caught expected TypeError:"
21 print e
22 else:
23 print "Failed to catch TypeError " \
24 "when registering a non-callable reduction function."
27 print
28 try:
29 copy_reg.pickle(type(1), int, "not a callable")
30 except TypeError, e:
31 print "Caught expected TypeError:"
32 print e
33 else:
34 print "Failed to catch TypeError " \
35 "when registering a non-callable constructor."