[IronPython] Solved: Re: PythonEngine bug

Stanislas Pinte stan at ertmssolutions.com
Fri Dec 2 15:17:48 CET 2005


Hello,

my apologies for the false warning:

actually, 

engine.AddToPath(Environment.CurrentDirectory); 

will add the directory of the assembly we are running, not the current directory.

I don't know if it is the expected behavior or not.

Thanks,

Stan.

Quoting Stanislas Pinte <stan at phidani.be>:

> hello,
> 
> I am having problems importing modules in the PythonEngine:
> 
> PythonEngine engine = new PythonEngine();
> engine.AddToPath(Environment.CurrentDirectory);
> engine.Import("hop");
> Function inc = engine.Evaluate("hop.increment") as Function;
> 
> whith hop.py being in the current directory, I get:
> 
> 1) TraceAnalyzer.test.ScriptingTests.TestPythonGlobalVariableUsageAcrossFunctionCalls :
> IronPython.Objects.PythonAttributeError : 'NoneType' object has no attribute 'increment'
> 
> Any idea?
> 
> Thanks a lot,
> 
> Stan.
> 
> 
> 
> 
> _______________________________________________
> users mailing list
> users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> 
> 
> 


-- 
-----------------------------------------------------------------
   Stanislas Pinte             e-mail: stan at ertmssolutions.com
   ERTMS Solutions               http://www.ertmssolutions.com
   Rue de l'Autonomie, 1             Tel:    + 322 - 522.06.63
   1070        Bruxelles              Fax:   + 322 - 522.09.30
----------------------------------------------------------------- 






More information about the Ironpython-users mailing list