Patchwork [6,of,8] py3: remove delayed import of importlib

login
register
mail settings
Submitter Gregory Szorc
Date May 13, 2017, 7:54 p.m.
Message ID <016157858ae7e6068116.1494705278@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/20610/
State Accepted
Headers show

Comments

Gregory Szorc - May 13, 2017, 7:54 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1494701739 25200
#      Sat May 13 11:55:39 2017 -0700
# Node ID 016157858ae7e60681163ba47dca6ba822319dbe
# Parent  20054f6926cca44d7efb13be3122f0f76bfa4e8c
py3: remove delayed import of importlib

All supported versions of Python now have importlib. This
effectively reverts b85fa6bf298b.

Patch

diff --git a/contrib/check-py3-compat.py b/contrib/check-py3-compat.py
--- a/contrib/check-py3-compat.py
+++ b/contrib/check-py3-compat.py
@@ -10,6 +10,7 @@ 
 from __future__ import absolute_import, print_function
 
 import ast
+import importlib
 import os
 import sys
 import traceback
@@ -50,7 +51,6 @@  def check_compat_py2(f):
 
 def check_compat_py3(f):
     """Check Python 3 compatibility of a file with Python 3."""
-    import importlib  # not available on Python 2.6
     with open(f, 'rb') as fh:
         content = fh.read()