mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 00:06:44 -04:00
dist: Support overriding list of built-in modules
Useful when building for a platform that has a different set of built-in modules
This commit is contained in:
parent
7cd4ca07ed
commit
eeba583176
9
direct/src/dist/FreezeTool.py
vendored
9
direct/src/dist/FreezeTool.py
vendored
@ -2378,6 +2378,8 @@ class PandaModuleFinder(modulefinder.ModuleFinder):
|
||||
:param debug: an integer indicating the level of verbosity
|
||||
"""
|
||||
|
||||
self.builtin_module_names = kw.pop('builtin_module_names', sys.builtin_module_names)
|
||||
|
||||
self.suffixes = kw.pop('suffixes', imp.get_suffixes())
|
||||
self.optimize = kw.pop('optimize', -1)
|
||||
|
||||
@ -2702,11 +2704,12 @@ class PandaModuleFinder(modulefinder.ModuleFinder):
|
||||
if fullname in overrideModules:
|
||||
return (None, '', ('.py', 'r', imp.PY_SOURCE))
|
||||
|
||||
# It's built into the interpreter.
|
||||
if fullname in self.builtin_module_names:
|
||||
return (None, None, ('', '', imp.C_BUILTIN))
|
||||
|
||||
# If no search path is given, look for a built-in module.
|
||||
if path is None:
|
||||
if name in sys.builtin_module_names:
|
||||
return (None, None, ('', '', imp.C_BUILTIN))
|
||||
|
||||
path = self.path
|
||||
|
||||
if fullname == 'distutils' and hasattr(sys, 'real_prefix'):
|
||||
|
Loading…
x
Reference in New Issue
Block a user