Patchwork [1,of,2] import-checker: allow *.pyd based stdlib modules

login
register
mail settings
Submitter Matt Harbison
Date April 9, 2015, 2:51 a.m.
Message ID <81873bb2a01d0b746171.1428547865@Envy>
Download mbox | patch
Permalink /patch/8567/
State Accepted
Headers show

Comments

Matt Harbison - April 9, 2015, 2:51 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1428546231 14400
#      Wed Apr 08 22:23:51 2015 -0400
# Node ID 81873bb2a01d0b746171a7e7c07667009f501d9e
# Parent  19c5b091396036e2ee63555b39a5852652b49d18
import-checker: allow *.pyd based stdlib modules

These are Windows dlls, and eliminate the following import check diffs that are
not on Unix:

  mercurial/changegroup.py mixed imports
     stdlib:    os, struct, tempfile, zlib
     relative:  bz2
  mercurial/encoding.py mixed imports
     stdlib:    locale, os
     relative:  unicodedata

Patch

diff --git a/contrib/import-checker.py b/contrib/import-checker.py
--- a/contrib/import-checker.py
+++ b/contrib/import-checker.py
@@ -90,7 +90,8 @@ 
             for name in files:
                 if name == '__init__.py':
                     continue
-                if not (name.endswith('.py') or name.endswith('.so')):
+                if not (name.endswith('.py') or name.endswith('.so')
+                        or name.endswith('.pyd')):
                     continue
                 full_path = os.path.join(top, name)
                 if 'site-packages' in full_path: