File tree Expand file tree Collapse file tree 2 files changed +0
-15
lines changed
Expand file tree Collapse file tree 2 files changed +0
-15
lines changed Original file line number Diff line number Diff line change 1111"""
1212
1313import sys
14- # import os.path as osp
1514from pathlib import Path
1615
1716def get_module_path (modname ):
1817 """Return module *modname* base path"""
19- #return osp.abspath(
20- # osp.dirname(sys.modules[modname].__file__)
21- #)
2218 return str (Path (sys .modules [modname ].__file__ ).parent .resolve ())
2319
2420
@@ -34,22 +30,12 @@ def get_module_data_path(
3430 return datapath
3531 else :
3632 datapath = get_module_path (modname )
37- # parentdir = osp.join(datapath, osp.pardir)
3833 parentdir = str (Path (datapath ).parent )
39- #if osp.isfile(parentdir):
4034 if Path (parentdir ).is_file ():
4135 # Parent directory is not a directory but the 'library.zip' file:
4236 # this is either a py2exe or a cx_Freeze distribution
43- #datapath = osp.abspath(
44- # osp.join(
45- # osp.join(parentdir, osp.pardir), modname
46- # )
47- #)
4837 datapath = str ((Path (parentdir ).parent / modname ).resolve ())
4938 if relpath is not None :
50- #datapath = osp.abspath(
51- # osp.join(datapath, relpath)
52- #)
5339 datapath = str ((Path (datapath ) / relpath ).resolve ())
5440 return datapath
5541
Original file line number Diff line number Diff line change @@ -104,7 +104,6 @@ def prepend_modules_to_path(module_base_path):
104104 messages = [
105105 prepend_module_to_path (dirname )
106106 for dirname in fnames
107- # if osp.isdir(dirname)
108107 if Path (dirname ).is_dir ()
109108 ]
110109 return os .linesep .join (messages )
You can’t perform that action at this time.
0 commit comments