For a project I'm working on, I'd like to put Python for .NET in a more
standard Python package that lives in site-packages.

However, the bootstrapping that happens in InitExt() in pythonengine.cs
doesn't work in that case. If I put together a package that looks like:

site-packages
    pythonnet
        __init__.py
        clr.pyd
        Python.Runtime.dll

add "from pythonnet" to the lines that the nasty bootstrapping hack looks
for in traceback, then when I call

from pythonnet import clr

Python goes into an infinite recursion loop. The import calls up initclr()
in ClrModule.cs, which calls InitExt() in pythonengine.cs, which calls
Python with the command "from pythonnet import clr", which calls initclr()
in ClrModule.cs, which calls InitExt()....

For whatever reason, this doesn't occur with a straight "import clr", if I
dump clr.pyd and Python.Runtime.dll in my root site-packages directory.

What's going on?
_________________________________________________
Python.NET mailing list - PythonDotNet@python.org
https://mail.python.org/mailman/listinfo/pythondotnet

Reply via email to