Turn off Python pickle test for old style classes

This commit is contained in:
William S Fulton 2016-10-14 19:48:37 +01:00
commit 4b4540056d

View file

@ -1,12 +1,19 @@
import python_pickle
import pickle
import sys
def is_new_style_class(cls):
return hasattr(cls, "__class__")
def check(p):
msg = p.msg
if msg != "hi there":
raise RuntimeError("Bad, got: " + msg)
if not is_new_style_class(python_pickle.PickleMe):
sys.exit(0)
python_pickle.cvar.debug = False
p = python_pickle.PickleMe("hi there")