[PATCH] import-checker: accept .pyc and .pyo files (issue4812)

Augie Fackler raf at durin42.com
Wed Sep 2 15:28:41 CDT 2015


> On Sep 2, 2015, at 16:16, timeless at mozdev.org wrote:
> 
> # HG changeset patch
> # User timeless at mozdev.org
> # Date 1441224455 14400
> #      Wed Sep 02 16:07:35 2015 -0400
> # Node ID db4607bedf0785a1c49bdf53544cf8548fe4cac7
> # Parent  f77a3f27cea533232dc107a72773e90e2de9549d
> import-checker: accept .pyc and .pyo files (issue4812)

queued, thanks

> 
> Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
> [GCC 4.2.1 (Apple Inc. build 5646)] on darwin
> 
> $ ls '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6'/BaseHTTPServer.py*
> /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/BaseHTTPServer.pyc
> /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/BaseHTTPServer.pyo
> 
> diff --git a/contrib/import-checker.py b/contrib/import-checker.py
> --- a/contrib/import-checker.py
> +++ b/contrib/import-checker.py
> @@ -200,7 +200,10 @@
>             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('.pyc')
> +                        or name.endswith('.pyo')
>                         or name.endswith('.pyd')):
>                     continue
>                 full_path = os.path.join(top, name)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list