diff --git a/builtin.py b/builtin.py index db271e37..f523780f 100644 --- a/builtin.py +++ b/builtin.py @@ -90,7 +90,9 @@ class Parser(CachedModule): @property def module(self): if not self._module: - self.sys_path.insert(0, self.path) + if self.path: + dir = os.path.dirname(self.path) + self.sys_path.insert(0, dir) temp, sys.path = sys.path, self.sys_path # TODO reenable and check (stackoverflow question - pylab builtins) @@ -99,7 +101,9 @@ class Parser(CachedModule): self.sys_path, sys.path = sys.path, temp - self.sys_path.pop(0) + if self.path: + self.sys_path.pop(0) + self._module = self._content['module'] #print 'mod', self._content['module'] return self._module diff --git a/test/completion/thirdparty/pylab.py b/test/completion/thirdparty/pylab.py new file mode 100644 index 00000000..60159216 --- /dev/null +++ b/test/completion/thirdparty/pylab.py @@ -0,0 +1,10 @@ +import pylab +pylab. + +import numpy + +#? ['array2string'] +numpy.array2string + +#? ['shape'] +numpy.matrix().shape