removed deprecated os.path.walk from setup.py (GitHub issue #11)
Showing
1 changed file
with
4 additions
and
4 deletions
1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python |
2 | 2 | ||
3 | -import subprocess | ||
4 | from distutils.core import setup | 3 | from distutils.core import setup |
5 | 4 | ||
6 | def doc_files () : | 5 | def doc_files () : |
... | @@ -18,16 +17,17 @@ def doc_files () : | ... | @@ -18,16 +17,17 @@ def doc_files () : |
18 | def resources (root) : | 17 | def resources (root) : |
19 | collected = ["*.txt", "*.html", "*.css", "*.js", "*.png", "*.jpg", | 18 | collected = ["*.txt", "*.html", "*.css", "*.js", "*.png", "*.jpg", |
20 | "*.ttf", "*.eot", "*.woff", "*.svg" ,"*.map"] | 19 | "*.ttf", "*.eot", "*.woff", "*.svg" ,"*.map"] |
21 | - import fnmatch, os.path | 20 | + import fnmatch, os, os.path |
22 | result = [] | 21 | result = [] |
23 | baselen = len(root.rstrip(os.sep).rsplit(os.sep, 1)[0]) + len(os.sep) | 22 | baselen = len(root.rstrip(os.sep).rsplit(os.sep, 1)[0]) + len(os.sep) |
24 | - def addfiles (_, dirname, filenames) : | 23 | + def addfiles (dirname, filenames) : |
25 | for name in filenames : | 24 | for name in filenames : |
26 | for glob in collected : | 25 | for glob in collected : |
27 | if fnmatch.fnmatch(name, glob) : | 26 | if fnmatch.fnmatch(name, glob) : |
28 | result.append(os.path.join(dirname[baselen:], name)) | 27 | result.append(os.path.join(dirname[baselen:], name)) |
29 | break | 28 | break |
30 | - os.path.walk(root, addfiles, None) | 29 | + for dirname, _, files in os.walk(root) : |
30 | + addfiles(dirname, files) | ||
31 | return result | 31 | return result |
32 | 32 | ||
33 | try : | 33 | try : | ... | ... |
-
Please register or login to post a comment