Update of /cvsroot/pycrust/PyCrust
In directory sc8-pr-cvs1:/tmp/cvs-serv21364
Modified Files:
editor.py
Log Message:
Better namespace updating.
Index: editor.py
===================================================================
RCS file: /cvsroot/pycrust/PyCrust/editor.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** editor.py 1 Apr 2003 20:05:08 -0000 1.8
--- editor.py 1 Apr 2003 23:20:33 -0000 1.9
***************
*** 156,160 ****
self.modulename = ''
self.syspath = sys.path[:]
- self.sysmodules = sys.modules.copy()
while True:
try:
--- 156,159 ----
***************
*** 183,194 ****
"""Update the namespace for autocompletion and calltips.
! Return False if there was an error."""
if self.editor.GetModify():
self.save()
backup = self.interp.locals
! modfile = None
try:
try:
- modfile, path, descr = imp.find_module(self.modulename)
module = imp.load_module(self.modulename, modfile, path, descr)
except:
--- 182,198 ----
"""Update the namespace for autocompletion and calltips.
! Return True if updated, False if there was an error."""
if self.editor.GetModify():
self.save()
backup = self.interp.locals
! syspath = sys.path
! sys.path = self.syspath
! try:
! del sys.modules[self.modulename]
! except KeyError:
! pass
! modfile, path, descr = imp.find_module(self.modulename)
try:
try:
module = imp.load_module(self.modulename, modfile, path, descr)
except:
***************
*** 196,208 ****
return False
else:
! self.interp.locals = module.__dict__.copy()
return True
finally:
if modfile:
modfile.close()
- try:
- del sys.modules[self.modulename]
- except KeyError:
- pass
def new(self, filepath):
--- 200,209 ----
return False
else:
! self.interp.locals = module.__dict__
return True
finally:
+ sys.path = syspath
if modfile:
modfile.close()
def new(self, filepath):
|