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
|
@ -421,7 +421,7 @@ class XMLParser:
|
|||
# Internal -- parse comment, return length or -1 if not terminated
|
||||
def parse_comment(self, i):
|
||||
rawdata = self.rawdata
|
||||
if rawdata[i:i+4] <> '<!--':
|
||||
if rawdata[i:i+4] != '<!--':
|
||||
raise Error('unexpected call to handle_comment')
|
||||
res = commentclose.search(rawdata, i+4)
|
||||
if res is None:
|
||||
|
@ -487,7 +487,7 @@ class XMLParser:
|
|||
# Internal -- handle CDATA tag, return length or -1 if not terminated
|
||||
def parse_cdata(self, i):
|
||||
rawdata = self.rawdata
|
||||
if rawdata[i:i+9] <> '<![CDATA[':
|
||||
if rawdata[i:i+9] != '<![CDATA[':
|
||||
raise Error('unexpected call to parse_cdata')
|
||||
res = cdataclose.search(rawdata, i+9)
|
||||
if res is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue