contrib: ignore empty files in check-py3-compat.py
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 12 Dec 2015 13:27:31 -0500
changeset 27331 35e69407b1ac
parent 27330 6fbf1159a85a
child 27332 04f346b8768f
contrib: ignore empty files in check-py3-compat.py
contrib/check-py3-compat.py
tests/test-check-py3-compat.t
--- a/contrib/check-py3-compat.py	Sat Dec 12 13:23:29 2015 -0500
+++ b/contrib/check-py3-compat.py	Sat Dec 12 13:27:31 2015 -0500
@@ -17,6 +17,10 @@
     with open(f, 'rb') as fh:
         content = fh.read()
 
+    # Ignore empty files.
+    if not content.strip():
+        return
+
     root = ast.parse(content)
     futures = set()
     haveprint = False
--- a/tests/test-check-py3-compat.t	Sat Dec 12 13:23:29 2015 -0500
+++ b/tests/test-check-py3-compat.t	Sat Dec 12 13:27:31 2015 -0500
@@ -15,7 +15,6 @@
   contrib/fixpax.py requires print_function
   contrib/hgclient.py not using absolute_import
   contrib/hgclient.py requires print_function
-  contrib/hgfixes/__init__.py not using absolute_import
   contrib/hgfixes/fix_bytes.py not using absolute_import
   contrib/hgfixes/fix_bytesmod.py not using absolute_import
   contrib/hgfixes/fix_leftover_imports.py not using absolute_import
@@ -125,7 +124,6 @@
   mercurial/mdiff.py not using absolute_import
   mercurial/obsolete.py not using absolute_import
   mercurial/patch.py not using absolute_import
-  mercurial/pure/__init__.py not using absolute_import
   mercurial/pure/base85.py not using absolute_import
   mercurial/pure/bdiff.py not using absolute_import
   mercurial/pure/diffhelpers.py not using absolute_import