Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

pythonnet (clr) hacks the import mechanism in Python - not compatible with Kivy #547

Closed
@den-run-ai

Description

@den-run-ai

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp