[Python.NET] How to get 'None' from .NET?

2005-04-14 Thread Boris Capitanu
Hello, I'm trying to call from .NET some function defined in a Python script, and pass 'null' as one of the parameters of the function in certain situations. I was expecting that the bridge would map the 'null' in .NET to 'None' in Python, however I receive an exception in .NET when I execute the

[Python.NET] ActivePython 2.4.1.245 problem

2005-04-14 Thread Boris Capitanu
Hi, I just upgraded my Python to ActiveState's 2.4.1 version and some thing apparently broke in the bridge. Here are some things I was able to do in version 2.4.0 that now no longer work: C:\Python24>python ActivePython 2.4.1 Build 245 (ActiveState Corp.) based on Python 2.4.1 (#65, Mar 30 2005

RE: [Python.NET] ActivePython 2.4.1.245 problem

2005-04-14 Thread Brian Lloyd
Hi Boris - this is actually fixed in my local copy (hope to check it in and make a new release soon, as this will affect anyone using the bootstrap hook in a native CPython). As a temporary workaround, you can arrange to hold a reference to the globals dictionary someplace before importing the

RE: [Python.NET] How to get 'None' from .NET?

2005-04-14 Thread Brian Lloyd
FromManagedObject wasn't handling this correctly - I've added a fix for the next release. In the meantime, the easiest thing to do is something like: PyObject module = PythonEngine.ImportModule("script") PyObject none = module.GetAttr("aliasForNone") (this presumes that in the module you have