summaryrefslogtreecommitdiffstats
path: root/Lib/plat-irix5
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-12-12 23:11:42 (GMT)
committerFred Drake <fdrake@acm.org>2000-12-12 23:11:42 (GMT)
commit132dce22469f476f399d1bbc6d1cc2f7ba0110cc (patch)
tree4b0988e41b3b7d25d10c2a24fb18b07ff376f66d /Lib/plat-irix5
parent63596aeb33c2837d7802449c8906349c9ea1998e (diff)
downloadcpython-132dce22469f476f399d1bbc6d1cc2f7ba0110cc.zip
cpython-132dce22469f476f399d1bbc6d1cc2f7ba0110cc.tar.gz
cpython-132dce22469f476f399d1bbc6d1cc2f7ba0110cc.tar.bz2
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.
Diffstat (limited to 'Lib/plat-irix5')
-rwxr-xr-xLib/plat-irix5/FL.py2
-rwxr-xr-xLib/plat-irix5/cdplayer.py2
-rwxr-xr-xLib/plat-irix5/flp.py16
-rwxr-xr-xLib/plat-irix5/jpeg.py2
-rwxr-xr-xLib/plat-irix5/panel.py2
-rwxr-xr-xLib/plat-irix5/panelparser.py2
-rwxr-xr-xLib/plat-irix5/readcd.py12
-rwxr-xr-xLib/plat-irix5/torgb.py6
8 files changed, 22 insertions, 22 deletions
diff --git a/Lib/plat-irix5/FL.py b/Lib/plat-irix5/FL.py
index f85237b..ae665e3 100755
--- a/Lib/plat-irix5/FL.py
+++ b/Lib/plat-irix5/FL.py
@@ -7,7 +7,7 @@ _v20 = 1
_v21 = 1
##import fl
##try:
-## _v20 = (fl.get_rgbmode <> None)
+## _v20 = (fl.get_rgbmode is not None)
##except:
## _v20 = 0
##del fl
diff --git a/Lib/plat-irix5/cdplayer.py b/Lib/plat-irix5/cdplayer.py
index eeb56ce..278da03 100755
--- a/Lib/plat-irix5/cdplayer.py
+++ b/Lib/plat-irix5/cdplayer.py
@@ -77,7 +77,7 @@ class Cdplayer:
line = old.readline()
if line == '':
break
- if line[:l] <> s:
+ if line[:l] != s:
new.write(line)
new.write(self.id + '.title:\t' + self.title + '\n')
new.write(self.id + '.artist:\t' + self.artist + '\n')
diff --git a/Lib/plat-irix5/flp.py b/Lib/plat-irix5/flp.py
index 6c6dae5..7d5814a 100755
--- a/Lib/plat-irix5/flp.py
+++ b/Lib/plat-irix5/flp.py
@@ -36,7 +36,7 @@ def parse_form(filename, formname):
#
def parse_forms(filename):
forms = checkcache(filename)
- if forms != None: return forms
+ if forms is not None: return forms
fp = _open_formfile(filename)
nforms = _parse_fd_header(fp)
forms = {}
@@ -168,7 +168,7 @@ def _open_formfile(filename):
return _open_formfile2(filename)[0]
def _open_formfile2(filename):
- if filename[-3:] <> '.fd':
+ if filename[-3:] != '.fd':
filename = filename + '.fd'
if filename[0] == '/':
try:
@@ -184,7 +184,7 @@ def _open_formfile2(filename):
break
except IOError:
fp = None
- if fp == None:
+ if fp is None:
raise error, 'Cannot find forms file ' + filename
return fp, filename
@@ -194,7 +194,7 @@ def _open_formfile2(filename):
def _parse_fd_header(file):
# First read the magic header line
datum = _parse_1_line(file)
- if datum <> ('Magic', 12321):
+ if datum != ('Magic', 12321):
raise error, 'Not a forms definition file'
# Now skip until we know number of forms
while 1:
@@ -208,10 +208,10 @@ def _parse_fd_header(file):
#
def _parse_fd_form(file, name):
datum = _parse_1_line(file)
- if datum <> FORMLINE:
+ if datum != FORMLINE:
raise error, 'Missing === FORM === line'
form = _parse_object(file)
- if form.Name == name or name == None:
+ if form.Name == name or name is None:
objs = []
for j in range(form.Numberofobjects):
obj = _parse_object(file)
@@ -316,7 +316,7 @@ def _parse_object(file):
if datum == FORMLINE:
file.seek(pos)
return obj
- if type(datum) <> type(()) or len(datum) <> 2:
+ if type(datum) is not type(()) or len(datum) != 2:
raise error, 'Parse error, illegal line in object: '+datum
obj.add(datum[0], datum[1])
@@ -339,7 +339,7 @@ def create_full_form(inst, (fdata, odatalist)):
#
def merge_full_form(inst, form, (fdata, odatalist)):
exec 'inst.'+fdata.Name+' = form\n'
- if odatalist[0].Class <> FL.BOX:
+ if odatalist[0].Class != FL.BOX:
raise error, 'merge_full_form() expects FL.BOX as first obj'
for odata in odatalist[1:]:
create_object_instance(inst, form, odata)
diff --git a/Lib/plat-irix5/jpeg.py b/Lib/plat-irix5/jpeg.py
index 298ebb5..da20d6b 100755
--- a/Lib/plat-irix5/jpeg.py
+++ b/Lib/plat-irix5/jpeg.py
@@ -59,7 +59,7 @@ def decompress(jpegdata):
return imgdata, width, height, bytesperpixel
def setoption(name, value):
- if type(value) <> type(0):
+ if type(value) is not type(0):
raise TypeError, 'jpeg.setoption: numeric options only'
if name == 'forcegrey':
name = 'forcegray'
diff --git a/Lib/plat-irix5/panel.py b/Lib/plat-irix5/panel.py
index 629bee5..f8388c6 100755
--- a/Lib/plat-irix5/panel.py
+++ b/Lib/plat-irix5/panel.py
@@ -207,7 +207,7 @@ def build_panel(descr):
#
# Sanity check
#
- if (not descr) or descr[0] <> 'panel':
+ if (not descr) or descr[0] != 'panel':
raise panel_error, 'panel description must start with "panel"'
#
if debug: show_panel('', descr)
diff --git a/Lib/plat-irix5/panelparser.py b/Lib/plat-irix5/panelparser.py
index 1b069fa..ee50971 100755
--- a/Lib/plat-irix5/panelparser.py
+++ b/Lib/plat-irix5/panelparser.py
@@ -71,7 +71,7 @@ syntax_error = 'syntax error'
# May raise syntax_error.
#
def parse_expr(tokens):
- if (not tokens) or tokens[0] <> '(':
+ if (not tokens) or tokens[0] != '(':
raise syntax_error, 'expected "("'
tokens = tokens[1:]
expr = []
diff --git a/Lib/plat-irix5/readcd.py b/Lib/plat-irix5/readcd.py
index 403353f..e000d35 100755
--- a/Lib/plat-irix5/readcd.py
+++ b/Lib/plat-irix5/readcd.py
@@ -93,7 +93,7 @@ class Readcd:
if prog < self.status[5] or prog > self.status[6]:
raise Error, 'range error'
end = self.pmsf2msf(prog, min, sec, frame)
- elif l <> 3:
+ elif l != 3:
raise Error, 'syntax error'
if type(start) == type(0):
if start < self.status[5] or start > self.status[6]:
@@ -111,7 +111,7 @@ class Readcd:
if prog < self.status[5] or prog > self.status[6]:
raise Error, 'range error'
start = self.pmsf2msf(prog, min, sec, frame)
- elif l <> 3:
+ elif l != 3:
raise Error, 'syntax error'
self.list.append((start, end))
@@ -127,10 +127,10 @@ class Readcd:
if self.playing:
start, end = self.list[self.listindex]
if type(end) == type(0):
- if cb_type <> CD.PNUM:
+ if cb_type != CD.PNUM:
self.parser.setcallback(cb_type, func, arg)
else:
- if cb_type <> CD.ATIME:
+ if cb_type != CD.ATIME:
self.parser.setcallback(cb_type, func, arg)
def removecallback(self, cb_type):
@@ -140,10 +140,10 @@ class Readcd:
if self.playing:
start, end = self.list[self.listindex]
if type(end) == type(0):
- if cb_type <> CD.PNUM:
+ if cb_type != CD.PNUM:
self.parser.removecallback(cb_type)
else:
- if cb_type <> CD.ATIME:
+ if cb_type != CD.ATIME:
self.parser.removecallback(cb_type)
def gettrackinfo(self, *arg):
diff --git a/Lib/plat-irix5/torgb.py b/Lib/plat-irix5/torgb.py
index 59e3fbe..7cc3b47 100755
--- a/Lib/plat-irix5/torgb.py
+++ b/Lib/plat-irix5/torgb.py
@@ -60,7 +60,7 @@ def torgb(filename):
ret = _torgb(filename, temps)
finally:
for temp in temps[:]:
- if temp <> ret:
+ if temp != ret:
try:
os.unlink(temp)
except os.error:
@@ -83,12 +83,12 @@ def _torgb(filename, temps):
if type(msg) == type(()) and len(msg) == 2 and \
type(msg[0]) == type(0) and type(msg[1]) == type(''):
msg = msg[1]
- if type(msg) <> type(''):
+ if type(msg) is not type(''):
msg = `msg`
raise error, filename + ': ' + msg
if ftype == 'rgb':
return fname
- if ftype == None or not table.has_key(ftype):
+ if ftype is None or not table.has_key(ftype):
raise error, \
filename + ': unsupported image file type ' + `ftype`
temp = tempfile.mktemp()