mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Update the code to better reflect recommended style:
Use != instead of <> since <> is documented as "obsolescent". Use "is" and "is not" when comparing with None or type objects.
This commit is contained in:
parent
c140131995
commit
8152d32375
36 changed files with 101 additions and 99 deletions
|
@ -12,7 +12,7 @@ def url2pathname(pathname):
|
|||
# XXXX The .. handling should be fixed...
|
||||
#
|
||||
tp = urllib.splittype(pathname)[0]
|
||||
if tp and tp <> 'file':
|
||||
if tp and tp != 'file':
|
||||
raise RuntimeError, 'Cannot convert non-local URL to pathname'
|
||||
# Turn starting /// into /, an empty hostname means current host
|
||||
if pathname[:3] == '///':
|
||||
|
@ -29,7 +29,7 @@ def url2pathname(pathname):
|
|||
components[i-1] not in ('', '..'):
|
||||
del components[i-1:i+1]
|
||||
i = i-1
|
||||
elif components[i] == '' and i > 0 and components[i-1] <> '':
|
||||
elif components[i] == '' and i > 0 and components[i-1] != '':
|
||||
del components[i]
|
||||
else:
|
||||
i = i+1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue