Commits

Denis Bilenko committed 7245b4a

test__examples.py: do not use ImportError to detected Python3. Do the right import the first time.

  • Participants
  • Parent commits fdd5d47

Comments (0)

Files changed (1)

greentest/test__examples.py

 import glob
 from os.path import join, abspath, dirname, normpath, basename
 import unittest
-try:
+if sys.version_info[0] == 3:
+    from urllib import request as urllib2
+else:
     import urllib2
-except ImportError:
-    from urllib import request as urllib2
 import time
 import signal
 import re