Skip to content

Commit 22b5ae2

Browse files
author
Ram Rachum
committed
-
1 parent 6799533 commit 22b5ae2

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

garlicsim_wx/py2exe_cruft/setup_extension.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -190,25 +190,19 @@ def get_all_submodules(package_name):
190190
For example:
191191
`get_all_subpackages('numpy') == ['numpy.core', 'numpy.random', ...]`
192192
'''
193-
return [
194-
(package_name + '.' + m) for m in
195-
setuptools.find_packages(
196-
imp.find_module(package_name, sys.path)[1]
197-
)
198-
]
199-
200-
201-
def get_strict_modules(package_name):
202-
'''tododoc'''
203193
package_path = imp.find_module(package_name, sys.path)[1]
204194
return [module for (loader, module, is_package) in
205-
pkgutil.iter_modules(path, package_name + '.') if not is_package]
195+
pkgutil.iter_modules([package_path], package_name + '.') if not is_package]
196+
197+
198+
g=get_all_submodules('numpy')
199+
0
206200

207201

208202
# This is a list of packages that should be included in the library, with all
209-
# their subpackages. In theory, the `packages` option of py2exe should take care
203+
# their submodules. In theory, the `packages` option of py2exe should take care
210204
# of it, but it has bugs in it so we're doing this ourselves.
211-
packages_to_include_with_all_subpackages = [
205+
packages_to_include_with_all_submodules = [
212206

213207
'garlicsim', 'garlicsim_lib',
214208

@@ -220,8 +214,8 @@ def get_strict_modules(package_name):
220214
# List of modules to be included in the library.
221215
includes = reduce(
222216
list.__add__,
223-
[get_all_subpackages(package_name) for package_name in \
224-
packages_to_include_with_all_subpackages]
217+
[get_all_submodules(package_name) for package_name in \
218+
packages_to_include_with_all_submodules]
225219
)
226220

227221

0 commit comments

Comments
 (0)