diff options
author | Fred Drake <fdrake@acm.org> | 2000-12-12 23:11:42 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-12-12 23:11:42 (GMT) |
commit | 132dce22469f476f399d1bbc6d1cc2f7ba0110cc (patch) | |
tree | 4b0988e41b3b7d25d10c2a24fb18b07ff376f66d /Lib/plat-irix5/flp.py | |
parent | 63596aeb33c2837d7802449c8906349c9ea1998e (diff) | |
download | cpython-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/flp.py')
-rwxr-xr-x | Lib/plat-irix5/flp.py | 16 |
1 files changed, 8 insertions, 8 deletions
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) |