mirror of
https://github.com/python/cpython.git
synced 2024-11-24 02:15:30 +08:00
Use string.ascii_letters instead of string.letters.
Remove unused import.
This commit is contained in:
parent
960fdf9ac3
commit
27eebb8c76
@ -21,7 +21,7 @@ def url2pathname(url):
|
||||
# make sure not to convert quoted slashes :-)
|
||||
return urllib.unquote('\\'.join(components))
|
||||
comp = url.split('|')
|
||||
if len(comp) != 2 or comp[0][-1] not in string.letters:
|
||||
if len(comp) != 2 or comp[0][-1] not in string.ascii_letters:
|
||||
error = 'Bad URL: ' + url
|
||||
raise IOError, error
|
||||
drive = comp[0][-1].upper()
|
||||
@ -42,7 +42,7 @@ def pathname2url(p):
|
||||
///C|/foo/bar/spam.foo
|
||||
"""
|
||||
|
||||
import string, urllib
|
||||
import urllib
|
||||
if not ':' in p:
|
||||
# No drive specifier, just convert slashes and quote the name
|
||||
if p[:2] == '\\\\':
|
||||
|
Loading…
Reference in New Issue
Block a user