Re: __import__ function broken in 2.6

2009-04-26 Thread Frank Millman
On Apr 25, 11:37 pm, Paul wrote: > Hi > > It seems in 2.6 you are no longer able to use the __import__ function > with different paths. I did not study your code in detail, so I may have missed something, but can't you use the 'imp' module for this? That still works in 2.6, and seems to be presen

Re: __import__ function broken in 2.6

2009-04-25 Thread Carl Banks
On Apr 25, 2:37 pm, Paul wrote: > It seems in 2.6 you are no longer able to use the __import__ function > with different paths. That functionality was deliberately removed, since it was never intended to be present in the first place, and it only "worked" before by accident. To get that behavior

Re: __import__ function broken in 2.6

2009-04-25 Thread Dave Angel
Paul wrote: Hi It seems in 2.6 you are no longer able to use the __import__ function with different paths. Here is our code: sys.path = g.origSysPath[:] # copy, not reference sys.path.insert(0, modulePath) sys.modules = g.origSysModules.copy()

Re: __import__ function broken in 2.6

2009-04-25 Thread Paul
We found a quick workaround to make import work with paths. We just append the folder we want to the system's path: sys.path.append( moduleFolder ) If anyone has a better solution, that would be great. Until then, this is ugly, but it works. -- http://mail.python.org/mailman/listi