[PATCH 5 of 8] import-checker: skip site-packages for virtualenv

timeless timeless at mozdev.org
Wed Mar 30 05:24:05 EDT 2016


# HG changeset patch
# User timeless <timeless at mozdev.org>
# Date 1459325405 0
#      Wed Mar 30 08:10:05 2016 +0000
# Node ID 54b962661f75e4a55c213c0eeb30f5d6024f7dbe
# Parent  9bdba93f0afd6ffe087663510f5198fdb8e40536
import-checker: skip site-packages for virtualenv

pygments was being treated as a stdlib...

diff --git a/contrib/import-checker.py b/contrib/import-checker.py
--- a/contrib/import-checker.py
+++ b/contrib/import-checker.py
@@ -206,6 +206,9 @@
         else:
             stdlib_prefixes.add(dirname)
     for libpath in sys.path:
+        # We need to skip virtualenv site-packages which are in stdlib_perfiexes
+        if 'site-packages' in libpath:
+            continue
         # We want to walk everything in sys.path that starts with
         # something in stdlib_prefixes. check-code suppressed because
         # the ast module used by this script implies the availability


More information about the Mercurial-devel mailing list