Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def in_system_path(filename):
"""
Return True if the file is in a system path
"""
return macholib.util.in_system_path(filename)
def not_system_filter(module):
"""
Return False if the module is located in a system directory
"""
return not in_system_path(module.filename)
def locate(self, filename):
if in_system_path(filename):
return filename
if filename.startswith(self.base):
return filename
for base in self.excludes:
if filename.startswith(base):
return filename
if filename in self.changemap:
return self.changemap[filename]
info = framework_info(filename)
if info is None:
res = self.copy_dylib(filename)
self.changemap[filename] = res
return res
else:
res = self.copy_framework(info)
self.changemap[filename] = res
def locate(self, filename):
if in_system_path(filename):
return filename
if filename.startswith(self.base):
return filename
for base in self.excludes:
if filename.startswith(base):
return filename
if filename in self.changemap:
return self.changemap[filename]
info = framework_info(filename)
if info is None:
res = self.copy_dylib(filename)
self.changemap[filename] = res
return res
else:
res = self.copy_framework(info)
self.changemap[filename] = res
def locate(self, filename):
if in_system_path(filename):
return filename
if filename.startswith(self.base):
return filename
for base in self.excludes:
if filename.startswith(base):
return filename
if filename in self.changemap:
return self.changemap[filename]
info = framework_info(filename)
if info is None:
res = self.copy_dylib(filename)
self.changemap[filename] = res
return res
else:
res = self.copy_framework(info)
self.changemap[filename] = res
def getClass(self, name, cls):
if in_system_path(name):
return ExcludedMachO
for base in self.excludes:
if name.startswith(base):
return ExcludedMachO
return cls
If the current Tcl installation is a Teapot-distributed version of ActiveTcl
*and* the current platform is OS X, log a non-fatal warning that the
resulting executable will (probably) fail to run on non-host systems.
PyInstaller does *not* freeze all ActiveTcl dependencies -- including
Teapot, which is typically ignorable. Since Teapot is *not* ignorable in
this case, this function warns of impending failure.
See Also
-------
https://github.com/pyinstaller/pyinstaller/issues/621
"""
from macholib import util
# System libraries do not experience this problem.
if util.in_system_path(tcl_root):
return
# Absolute path of the "init.tcl" script.
try:
init_resource = [r[1] for r in tcltree if r[1].endswith('init.tcl')][0]
# If such script could not be found, silently return.
except IndexError:
return
mentions_activetcl = False
mentions_teapot = False
with open(init_resource, 'r') as init_file:
for line in init_file.readlines():
line = line.strip().lower()
if line.startswith('#'):
continue
def getClass(self, name, cls):
if in_system_path(name):
return ExcludedMachO
for base in self.excludes:
if name.startswith(base):
return ExcludedMachO
return cls