- Notifications
You must be signed in to change notification settings - Fork749
Description
https://groups.google.com/forum/#!search/pythonnet%7Csort:date/kivy-users/X0R7FUtysAk/IBKUJuyGBQAJ
The problem was that importing the clr module does modify theimport function and this seems to be globally.
For standard importing (i.e. import xyz or from xyz imprt abc) this does not cause a problem, but in kivy/factory.py it callsimport in a way that is not supported by the overriddenimport() from the clr implementation.
As a work around I now have factory.py create a reference to theimport as self._local_import and then around line 140 in factory.py I replace
module =import(name=item['module'], fromlist='.')
with
module = self._local_import(name=item['module'], fromlist='.')
And it appears that as long as factory.py is used at least once before the clr module is imported then things seem to work out.
This seems like a hack and I would prefer to have something local to the clr importing that revertsimport to what it was, but my attempts to do so only fixed theimport locally to the module that did the importing and not globally like the import clr is doing.
I guess this is more of a python thing but can anyone think of a way to correct this w/o having to modify kivy/factory.py?