Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.

add load_module(more standard module) #22

Closed
wants to merge 4 commits into from

Conversation

noodle4u
Copy link
Contributor

1,add load_module()
2,import will use load_module
before load() will gen a none standard python module,can't been pickle.
the two above will gen a standard python module.
if thrift.file is subpath of any sys.path,use load_module is prefer.
otherwise(eg,thrift.file out of project path),use load_file.
for backward compatible,load is point to load_file

i add name,file to load_result thrift_scheme,and add module to sys.modules while load_module()
also a gen_module_name(),try guess name form thrift_file

1,add load_module()
2,import will use load_module
before load() will gen a none standard python module,can't been pickle.
the two above will gen a standard python module.
if thrift.file is subpath of any sys.path,use load_module is prefer.
otherwise(eg,thrift.file out of project path),use load_file.
for backward compatible,load is point to load_file

i add __name__,__file__ to load_result thrift_scheme,and add module to sys.modules while load_module()
also a gen_module_name(),try guess __name__ form thrift_file
jia zai biao zhun mo kuai
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant