Skip to contentSkip to conversation

graph-depends: rename pkgutil.py to brpkgutil.py

PATCH New yegorslists at googlemail.com 4 participants 4 messages Mar 21, 2017 – Mar 30, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 graph-depends: rename pkgutil.py to brpkgutil.py

From: Yegor Yefremov <[email protected]>

pkgutil.py is also part of Python itself. Placing pkgutil.py as is in a folder with other scripts that require original pkgutil will break them. This is the case with scanpypi. So rename pkgutil.py to brpkgutil.py to avoid naming collision.

---
 support/scripts/{pkgutil.py => brpkgutil.py} | 0
 support/scripts/graph-depends                | 8 ++++----
 2 files changed, 4 insertions(+), 4 deletions(-)
 rename support/scripts/{pkgutil.py => brpkgutil.py} (100%)
support/scripts/brpkgutil.py renamed from support/scripts/pkgutil.py +0 -0
similarity index 100%
rename from support/scripts/pkgutil.py
rename to support/scripts/brpkgutil.py
support/scripts/graph-depends +4 -4
index fbd591705..b258c565b 100755
@@ -26,7 +26,7 @@ import subprocess
 import argparse
 from fnmatch import fnmatch
 
-import pkgutil
+import brpkgutil
 
 # Modes of operation:
 MODE_FULL = 1   # draw full dependency graph for all selected packages
@@ -102,13 +102,13 @@ else:
 transitive = args.transitive
 
 if args.direct:
-    get_depends_func = pkgutil.get_depends
+    get_depends_func = brpkgutil.get_depends
     arrow_dir = "forward"
 else:
     if mode == MODE_FULL:
         sys.stderr.write("--reverse needs a package\n")
         sys.exit(1)
-    get_depends_func = pkgutil.get_rdepends
+    get_depends_func = brpkgutil.get_rdepends
     arrow_dir = "back"
 
 # Get the colours: we need exactly three colours,
@@ -330,7 +330,7 @@ if check_only:
     sys.exit(0)
 
 dict_deps = remove_extra_deps(dict_deps)
-dict_version = pkgutil.get_version([pkg for pkg in allpkgs
+dict_version = brpkgutil.get_version([pkg for pkg in allpkgs
                                 if pkg != "all" and not pkg.startswith("root")])
 
 # Print the attributes of a node: label and fill-color
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 graph-depends: rename pkgutil.py to brpkgutil.py

Quoted 10 lines · yegorslists at googlemail.com

From: Yegor Yefremov <[email protected]>

pkgutil.py is also part of Python itself. Placing pkgutil.py as is in a folder with other scripts that require original pkgutil will break them. This is the case with scanpypi. So rename pkgutil.py to brpkgutil.py to avoid naming collision.

Regards,
Arnout

Quoted 49 lines
---
 support/scripts/{pkgutil.py => brpkgutil.py} | 0
 support/scripts/graph-depends                | 8 ++++----
 2 files changed, 4 insertions(+), 4 deletions(-)
 rename support/scripts/{pkgutil.py => brpkgutil.py} (100%)
support/scripts/brpkgutil.py renamed from support/scripts/pkgutil.py +0 -0
similarity index 100%
rename from support/scripts/pkgutil.py
rename to support/scripts/brpkgutil.py
support/scripts/graph-depends +4 -4
index fbd591705..b258c565b 100755
@@ -26,7 +26,7 @@ import subprocess
 import argparse
 from fnmatch import fnmatch
 
-import pkgutil
+import brpkgutil
 
 # Modes of operation:
 MODE_FULL = 1   # draw full dependency graph for all selected packages
@@ -102,13 +102,13 @@ else:
 transitive = args.transitive
 
 if args.direct:
-    get_depends_func = pkgutil.get_depends
+    get_depends_func = brpkgutil.get_depends
     arrow_dir = "forward"
 else:
     if mode == MODE_FULL:
         sys.stderr.write("--reverse needs a package\n")
         sys.exit(1)
-    get_depends_func = pkgutil.get_rdepends
+    get_depends_func = brpkgutil.get_rdepends
     arrow_dir = "back"
 
 # Get the colours: we need exactly three colours,
@@ -330,7 +330,7 @@ if check_only:
     sys.exit(0)
 
 dict_deps = remove_extra_deps(dict_deps)
-dict_version = pkgutil.get_version([pkg for pkg in allpkgs
+dict_version = brpkgutil.get_version([pkg for pkg in allpkgs
                                 if pkg != "all" and not pkg.startswith("root")])
 
 # Print the attributes of a node: label and fill-color
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#2 lore raw

PATCH 1/1 graph-depends: rename pkgutil.py to brpkgutil.py

In reply to yegorslists at googlemail.com

Hello,

Quoted 7 lines · yegorslists at googlemail.com

From: Yegor Yefremov <[email protected]>

pkgutil.py is also part of Python itself. Placing pkgutil.py as is in a folder with other scripts that require original pkgutil will break them. This is the case with scanpypi. So rename pkgutil.py to brpkgutil.py to avoid naming collision.

Quoted 8 lines
---
 support/scripts/{pkgutil.py => brpkgutil.py} | 0
 support/scripts/graph-depends                | 8 ++++----
 2 files changed, 4 insertions(+), 4 deletions(-)
 rename support/scripts/{pkgutil.py => brpkgutil.py} (100%)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 1/1 graph-depends: rename pkgutil.py to brpkgutil.py

In reply to yegorslists at googlemail.com
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"yegorslists" == yegorslists <[email protected]> writes:

From: Yegor Yefremov <[email protected]> pkgutil.py is also part of Python itself. Placing pkgutil.py as is in a folder with other scripts that require original pkgutil will break them. This is the case with scanpypi. So rename pkgutil.py to brpkgutil.py to avoid naming collision.

Committed to 2017.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard