mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +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
|
@ -189,7 +189,7 @@ class BinHex:
|
|||
hqxer = _Hqxcoderengine(ofp)
|
||||
self.ofp = _Rlecoderengine(hqxer)
|
||||
self.crc = 0
|
||||
if finfo == None:
|
||||
if finfo is None:
|
||||
finfo = FInfo()
|
||||
self.dlen = dlen
|
||||
self.rlen = rlen
|
||||
|
@ -228,7 +228,7 @@ class BinHex:
|
|||
self._write(data)
|
||||
|
||||
def close_data(self):
|
||||
if self.dlen <> 0:
|
||||
if self.dlen != 0:
|
||||
raise Error, 'Incorrect data size, diff='+`self.rlen`
|
||||
self._writecrc()
|
||||
self.state = _DID_DATA
|
||||
|
@ -246,7 +246,7 @@ class BinHex:
|
|||
self.close_data()
|
||||
if self.state != _DID_DATA:
|
||||
raise Error, 'Close at the wrong time'
|
||||
if self.rlen <> 0:
|
||||
if self.rlen != 0:
|
||||
raise Error, \
|
||||
"Incorrect resource-datasize, diff="+`self.rlen`
|
||||
self._writecrc()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue