ThirdParty/Pygments/pygments/lexers/_phpbuiltins.py

branch
Py2 comp.
changeset 2669
11a6696ff868
parent 2525
8b507a9a2d40
child 3145
a9de05d4a22f
--- a/ThirdParty/Pygments/pygments/lexers/_phpbuiltins.py	Sun Apr 21 20:30:56 2013 +0200
+++ b/ThirdParty/Pygments/pygments/lexers/_phpbuiltins.py	Thu May 23 19:58:41 2013 +0200
@@ -3713,7 +3713,10 @@
     import re
     import shutil
     import tarfile
-    import urllib.request, urllib.parse, urllib.error
+    try:  # Py3
+        import urllib.request as request
+    except (ImportError):
+        import urllib2 as request   # __IGNORE_WARNING__
 
     PHP_MANUAL_URL     = 'http://us3.php.net/distributions/manual/php_manual_en.tar.gz'
     PHP_MANUAL_DIR     = './php-chunked-xhtml/'
@@ -3754,7 +3757,7 @@
         return modules
 
     def get_php_references():
-        download = urllib.request.urlretrieve(PHP_MANUAL_URL)
+        download = request.urlretrieve(PHP_MANUAL_URL)
         tar = tarfile.open(download[0])
         tar.extractall()
         tar.close()

eric ide

mercurial