[Python-checkins] cpython: Remove redundant imports

raymond.hettinger python-checkins at python.org
Sun Apr 7 05:53:18 CEST 2013


http://hg.python.org/cpython/rev/472494ced67f
changeset: 83174:472494ced67f
user: Raymond Hettinger <python at rcn.com>
date: Sat Apr 06 20:53:12 2013 -0700
summary:
 Remove redundant imports
files:
 Lib/urllib/parse.py | 9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py
--- a/Lib/urllib/parse.py
+++ b/Lib/urllib/parse.py
@@ -846,7 +846,6 @@
 """splittype('type:opaquestring') --> 'type', 'opaquestring'."""
 global _typeprog
 if _typeprog is None:
- import re
 _typeprog = re.compile('^([^/:]+):')
 
 match = _typeprog.match(url)
@@ -860,7 +859,6 @@
 """splithost('//host[:port]/path') --> 'host[:port]', '/path'."""
 global _hostprog
 if _hostprog is None:
- import re
 _hostprog = re.compile('^//([^/?]*)(.*)$')
 
 match = _hostprog.match(url)
@@ -877,7 +875,6 @@
 """splituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'."""
 global _userprog
 if _userprog is None:
- import re
 _userprog = re.compile('^(.*)@(.*)$')
 
 match = _userprog.match(host)
@@ -889,7 +886,6 @@
 """splitpasswd('user:passwd') -> 'user', 'passwd'."""
 global _passwdprog
 if _passwdprog is None:
- import re
 _passwdprog = re.compile('^([^:]*):(.*)$',re.S)
 
 match = _passwdprog.match(user)
@@ -902,7 +898,6 @@
 """splitport('host:port') --> 'host', 'port'."""
 global _portprog
 if _portprog is None:
- import re
 _portprog = re.compile('^(.*):([0-9]+)$')
 
 match = _portprog.match(host)
@@ -917,7 +912,6 @@
 Return None if ':' but not a valid number."""
 global _nportprog
 if _nportprog is None:
- import re
 _nportprog = re.compile('^(.*):(.*)$')
 
 match = _nportprog.match(host)
@@ -936,7 +930,6 @@
 """splitquery('/path?query') --> '/path', 'query'."""
 global _queryprog
 if _queryprog is None:
- import re
 _queryprog = re.compile('^(.*)\?([^?]*)$')
 
 match = _queryprog.match(url)
@@ -948,7 +941,6 @@
 """splittag('/path#tag') --> '/path', 'tag'."""
 global _tagprog
 if _tagprog is None:
- import re
 _tagprog = re.compile('^(.*)#([^#]*)$')
 
 match = _tagprog.match(url)
@@ -966,7 +958,6 @@
 """splitvalue('attr=value') --> 'attr', 'value'."""
 global _valueprog
 if _valueprog is None:
- import re
 _valueprog = re.compile('^([^=]*)=(.*)$')
 
 match = _valueprog.match(attr)
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /