diff options
author | Pearu Peterson <pearu.peterson@gmail.com> | 2006-03-30 07:55:30 +0000 |
---|---|---|
committer | Pearu Peterson <pearu.peterson@gmail.com> | 2006-03-30 07:55:30 +0000 |
commit | a873580ec504bee32ab45556d4083873de9d4918 (patch) | |
tree | f428e50fc27d2ef80e643349cf3db934ebd15217 /numpy/_import_tools.py | |
parent | 4a5ed4f6c97a6bdb8b578210e7e1ba0906e74030 (diff) | |
download | numpy-a873580ec504bee32ab45556d4083873de9d4918.tar.gz |
Fixed errors when trying to import freezed numpy scripts.
Diffstat (limited to 'numpy/_import_tools.py')
-rw-r--r-- | numpy/_import_tools.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/numpy/_import_tools.py b/numpy/_import_tools.py index 24ef49219..2155dc4bd 100644 --- a/numpy/_import_tools.py +++ b/numpy/_import_tools.py @@ -13,7 +13,10 @@ class PackageLoader: self.parent_frame = frame = sys._getframe(1) self.parent_name = eval('__name__',frame.f_globals,frame.f_locals) - self.parent_path = eval('__path__',frame.f_globals,frame.f_locals) + parent_path = eval('__path__',frame.f_globals,frame.f_locals) + if isinstance(parent_path, str): + parent_path = [parent_path] + self.parent_path = parent_path if not frame.f_locals.has_key('__all__'): exec('__all__ = []',frame.f_globals,frame.f_locals) self.parent_export_names = eval('__all__',frame.f_globals,frame.f_locals) @@ -279,7 +282,7 @@ class PackageLoader: def _format_titles(self,titles,colsep='---'): display_window_width = 70 # How to determine the correct value in runtime?? - lengths = [len(name)-name.find('.')-1 for (name,title) in titles] + lengths = [len(name)-name.find('.')-1 for (name,title) in titles]+[0] max_length = max(lengths) lines = [] for (name,title) in titles: |