Message101547
I don't think this conversion is correct. If there is a test for InstanceType, there is (IMO) a fifty-fifty-chance that it is there to distinguish old-style and new-style classes, so converting it to object is most likely to break the code.
People who actually want this conversion to happen could replace types.InstanceType with
getattr(types, 'InstanceType', object)
or add
try:
from types import InstanceType
except ImportError:
InstanceType = object
to the top of the module; this would then work for both 2.x and 3.x (assuming that replacing InstanceType with object is actually correct in the code in question). |
|
Date |
User |
Action |
Args |
2010-03-22 22:58:39 | loewis | set | recipients:
+ loewis, ericp |
2010-03-22 22:58:39 | loewis | set | messageid: <1269298719.66.0.659421150592.issue8206@psf.upfronthosting.co.za> |
2010-03-22 22:58:38 | loewis | link | issue8206 messages |
2010-03-22 22:58:38 | loewis | create | |
|