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 11
11
"""
12
12
13
13
import sys
14
- # import os.path as osp
15
14
from pathlib import Path
16
15
17
16
def get_module_path (modname ):
18
17
"""Return module *modname* base path"""
19
- #return osp.abspath(
20
- # osp.dirname(sys.modules[modname].__file__)
21
- #)
22
18
return str (Path (sys .modules [modname ].__file__ ).parent .resolve ())
23
19
24
20
@@ -34,22 +30,12 @@ def get_module_data_path(
34
30
return datapath
35
31
else :
36
32
datapath = get_module_path (modname )
37
- # parentdir = osp.join(datapath, osp.pardir)
38
33
parentdir = str (Path (datapath ).parent )
39
- #if osp.isfile(parentdir):
40
34
if Path (parentdir ).is_file ():
41
35
# Parent directory is not a directory but the 'library.zip' file:
42
36
# 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
- #)
48
37
datapath = str ((Path (parentdir ).parent / modname ).resolve ())
49
38
if relpath is not None :
50
- #datapath = osp.abspath(
51
- # osp.join(datapath, relpath)
52
- #)
53
39
datapath = str ((Path (datapath ) / relpath ).resolve ())
54
40
return datapath
55
41
Original file line number Diff line number Diff line change @@ -104,7 +104,6 @@ def prepend_modules_to_path(module_base_path):
104
104
messages = [
105
105
prepend_module_to_path (dirname )
106
106
for dirname in fnames
107
- # if osp.isdir(dirname)
108
107
if Path (dirname ).is_dir ()
109
108
]
110
109
return os .linesep .join (messages )
You can’t perform that action at this time.
0 commit comments