module file path sent to client should only contain "/" as separator

This commit is contained in:
deathfantasy 2015-10-02 01:34:50 +07:00
parent 2c17e6fc12
commit 90d4ab6590
1 changed files with 3 additions and 2 deletions

View File

@ -102,7 +102,8 @@ class PupyClient(object):
For other platforms : loading .so in memory is not supported yet.
"""
modules_dic={}
start_path=module_name.replace(".",os.sep)
# start path should only use "/" as separator
start_path=module_name.replace(".", "/")
package_found=False
package_path=None
for search_path in self.get_packages_path():
@ -123,7 +124,7 @@ class PupyClient(object):
with open(filepath,'rb') as f:
module_code=f.read()
cur=""
for rep in start_path.split(os.sep)[:-1]:
for rep in start_path.split("/")[:-1]:
if not cur+rep+"/__init__.py" in modules_dic:
modules_dic[rep+"/__init__.py"]=""
cur+=rep+"/"