From: Guido van Rossum Date: Tue, 23 Aug 1994 13:29:21 +0000 (+0000) Subject: * Lib/sgi/flp.py: fix caching bug (always write the whole file to X-Git-Tag: v1.1~170 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9e1e149a5fbb0b24c4f3b7a2cc52e5236a715ee4;p=thirdparty%2FPython%2Fcpython.git * Lib/sgi/flp.py: fix caching bug (always write the whole file to the cache!) --- diff --git a/Lib/irix5/flp.py b/Lib/irix5/flp.py index bc4a8ab00f19..84c40aa0ba48 100755 --- a/Lib/irix5/flp.py +++ b/Lib/irix5/flp.py @@ -23,22 +23,12 @@ error = 'flp.error' # def parse_form(filename, formname): forms = checkcache(filename) - if forms != None: - if forms.has_key(formname): - return forms[formname] - else: - forms = {} - fp = _open_formfile(filename) - nforms = _parse_fd_header(fp) - for i in range(nforms): - form = _parse_fd_form(fp, formname) - if form <> None: - break + if forms is None: + forms = parse_forms(filename) + if forms.has_key(formname): + return forms[formname] else: raise error, 'No such form in fd file' - forms[formname] = form - writecache(filename, forms) - return form # # Externally visible function. Load all forms. diff --git a/Lib/plat-irix5/flp.py b/Lib/plat-irix5/flp.py index bc4a8ab00f19..84c40aa0ba48 100755 --- a/Lib/plat-irix5/flp.py +++ b/Lib/plat-irix5/flp.py @@ -23,22 +23,12 @@ error = 'flp.error' # def parse_form(filename, formname): forms = checkcache(filename) - if forms != None: - if forms.has_key(formname): - return forms[formname] - else: - forms = {} - fp = _open_formfile(filename) - nforms = _parse_fd_header(fp) - for i in range(nforms): - form = _parse_fd_form(fp, formname) - if form <> None: - break + if forms is None: + forms = parse_forms(filename) + if forms.has_key(formname): + return forms[formname] else: raise error, 'No such form in fd file' - forms[formname] = form - writecache(filename, forms) - return form # # Externally visible function. Load all forms.