File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 16
16
17
17
from distutils .core import setup
18
18
import os
19
- import os .path as osp
20
-
19
+ # import os.path as osp
20
+ from pathlib import Path
21
21
22
22
def get_package_data (name , extlist ):
23
23
"""Return data files for package *name* with extensions in *extlist*"""
@@ -28,10 +28,12 @@ def get_package_data(name, extlist):
28
28
for fname in filenames :
29
29
if (
30
30
not fname .startswith ('.' )
31
- and osp .splitext (fname )[1 ] in extlist
31
+ # and osp.splitext(fname)[1] in extlist
32
+ and Path (fname ).suffix in extlist
32
33
):
33
34
flist .append (
34
- osp .join (dirpath , fname )[offset :]
35
+ # osp.join(dirpath, fname)[offset:]
36
+ str (Path (dirpath ) / fname )[offset :]
35
37
)
36
38
return flist
37
39
@@ -40,7 +42,9 @@ def get_subpackages(name):
40
42
"""Return subpackages of package *name*"""
41
43
splist = []
42
44
for dirpath , _dirnames , _filenames in os .walk (name ):
43
- if osp .isfile (osp .join (dirpath , '__init__.py' )):
45
+ # if osp.isfile(osp.join(dirpath, '__init__.py')):
46
+ # if osp.isfile(str(Path(dirpath) / '__init__.py')):
47
+ if (Path (dirpath ) / '__init__.py' ).is_file ():
44
48
splist .append ("." .join (dirpath .split (os .sep )))
45
49
return splist
46
50
You can’t perform that action at this time.
0 commit comments