Changeset 5945
- Timestamp:
- 10/09/08 16:53:12 (2 months ago)
- Files:
-
- branches/1.2.x/numpy/lib/utils.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.2.x/numpy/lib/utils.py
r5660 r5945 1 1 import os 2 2 import sys 3 import pkgutil4 3 import types 5 4 import re … … 683 682 except AttributeError: 684 683 _all = None 684 685 685 # import sub-packages 686 686 if import_modules and hasattr(item, '__path__'): 687 for m in pkgutil.iter_modules(item.__path__): 688 if _all is not None and m[1] not in _all: 689 continue 690 try: 691 __import__("%s.%s" % (name, m[1])) 692 except ImportError: 693 continue 687 for pth in item.__path__: 688 for mod_path in os.listdir(pth): 689 init_py = os.path.join(pth, mod_path, '__init__.py') 690 if not os.path.isfile(init_py): 691 continue 692 if _all is not None and mod_path not in _all: 693 continue 694 try: 695 __import__("%s.%s" % (name, mod_path)) 696 except ImportError: 697 continue 698 694 699 for n, v in inspect.getmembers(item): 695 700 if _all is not None and n not in _all:
