Turn off Python pickle test for old style classes
This commit is contained in:
parent
1331234cf9
commit
4b4540056d
1 changed files with 7 additions and 0 deletions
|
|
@ -1,12 +1,19 @@
|
||||||
import python_pickle
|
import python_pickle
|
||||||
|
|
||||||
import pickle
|
import pickle
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def is_new_style_class(cls):
|
||||||
|
return hasattr(cls, "__class__")
|
||||||
|
|
||||||
def check(p):
|
def check(p):
|
||||||
msg = p.msg
|
msg = p.msg
|
||||||
if msg != "hi there":
|
if msg != "hi there":
|
||||||
raise RuntimeError("Bad, got: " + msg)
|
raise RuntimeError("Bad, got: " + msg)
|
||||||
|
|
||||||
|
if not is_new_style_class(python_pickle.PickleMe):
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
python_pickle.cvar.debug = False
|
python_pickle.cvar.debug = False
|
||||||
|
|
||||||
p = python_pickle.PickleMe("hi there")
|
p = python_pickle.PickleMe("hi there")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue