Kaydet (Commit) c0fe82ca authored tarafından Greg Ward's avatar Greg Ward

Fix long-hidden inconsistency in internal interface: 'find_modules()' now

represents packages as strings, not tuples.  This allowed a simplification
in 'get_package_dir()', too -- can now assume that 'package' is a string.
üst 16168477
...@@ -93,12 +93,7 @@ class build_py (Command): ...@@ -93,12 +93,7 @@ class build_py (Command):
distribution, where package 'package' should be found distribution, where package 'package' should be found
(at least according to the 'package_dir' option, if any).""" (at least according to the 'package_dir' option, if any)."""
if type (package) is StringType: path = string.split (package, '.')
path = string.split (package, '.')
elif type (package) in (TupleType, ListType):
path = list (package)
else:
raise TypeError, "'package' must be a string, list, or tuple"
if not self.package_dir: if not self.package_dir:
if path: if path:
...@@ -220,7 +215,7 @@ class build_py (Command): ...@@ -220,7 +215,7 @@ class build_py (Command):
for module in self.py_modules: for module in self.py_modules:
path = string.split (module, '.') path = string.split (module, '.')
package = tuple (path[0:-1]) package = string.join(path[0:-1], '.')
module_base = path[-1] module_base = path[-1]
try: try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment