[Pyobjc-dev] Segmentation fault when patching a namespace
Brought to you by:
ronaldoussoren
|
From: Orestis M. <or...@or...> - 2009-05-26 11:08:22
|
Hi,
as part of unit-testing our PyObjC app, I'm trying to use mocks for
some Obj-C classes, to make things easier. Unfortunately it leads to a
segmentation fault. Even more annoyingly I can't reproduce for a
simple case.
Here's what the pattern looks like:
from package import module as aModule
original = aModule.CALayerSubclass
milestoneModule.CALayerSubclass = Mock()
in 'module', we have, among others, the following:
...more
from Foundation import *
from AppKit import *
from Quartz import *
from other.another import CALayerSubclass
...more
and other.another has just these imports:
import sys
from math import ceil
from AppKit import *
from Foundation import *
from Quartz import *
A similar situation, when extracted to three python modules and run
works fine, so it's probably an interaction somewhere else.
Any pointers to what I should be looking at are welcome! I tried
fiddling with sys.modules, in the suspicion that something somewhere
is keeping a reference to the original class, but to no avail.
Thanks,
Orestis
--
or...@or...
http://orestis.gr/
|