Hello,
I'm getting the following stack trace when running my frozen script:
Traceback (most recent call last):
File
"/opt/rh/python27/root/usr/lib64/python2.7/site-packages/cx_Freeze/initscripts/Console.py",
line 27, in <module>
exec(code, m.__dict__)
File "controller.py", line 1, in <module>
import caller
File "/root/temp/fail/caller.py", line 3, in <module>
handler.register_service('something')
File "/root/temp/fail/handler.py", line 6, in register_service
m._SERVICE_NAME = service
AttributeError: 'NoneType' object has no attribute '_SERVICE_NAME'
The root cause is inspect.getmodule fails to locate the module of caller.
Any ideas how can I get this fixed ? Unfortunately this code is part of a
3rd-party library code which I cannot change.
This is my setup.py:
import sys
from cx_Freeze import setup, Executable
options = {
'build_exe': {
}
}
executables = [
Executable('controller.py')
]
setup( name = "fail",
version = "0.0.1",
options = options,
executables = executables)
This is the source code for controller.py:
import caller
if __name__ == "__main__":
print 'random stuff here'
This is the source for caller.py:
import handler
handler.register_service('something')
And this is the code for handler.py:
import inspect
def register_service(service):
frm = inspect.stack()[1]
m = inspect.getmodule(frm[0])
m._SERVICE_NAME = service
Thanks
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
cx-freeze-users mailing list
cx-freeze-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cx-freeze-users