From: Sjoerd Mullender Date: Mon, 29 Mar 1993 10:49:59 +0000 (+0000) Subject: Added some error checking. X-Git-Tag: v0.9.9~75 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8562c4cee6a8b2fac329bb977e38f089e01597b6;p=thirdparty%2FPython%2Fcpython.git Added some error checking. --- diff --git a/Lib/irix5/cddb.py b/Lib/irix5/cddb.py index 75313124c976..d07a63e2a5c0 100755 --- a/Lib/irix5/cddb.py +++ b/Lib/irix5/cddb.py @@ -87,7 +87,16 @@ class Cddb(): if self.toc != value: print 'toc\'s don\'t match' elif name1[:5] == 'track': - trackno = string.atoi(name1[5:]) + try: + trackno = string.atoi(name1[5:]) + except strings.atoi_error: + print 'syntax error in ' + file + continue + if trackno > ntracks: + print 'track number ' + trackno + \ + ' in file ' + file + \ + ' out of range' + continue self.track[trackno] = value f.close() return self diff --git a/Lib/plat-irix5/cddb.py b/Lib/plat-irix5/cddb.py index 75313124c976..d07a63e2a5c0 100755 --- a/Lib/plat-irix5/cddb.py +++ b/Lib/plat-irix5/cddb.py @@ -87,7 +87,16 @@ class Cddb(): if self.toc != value: print 'toc\'s don\'t match' elif name1[:5] == 'track': - trackno = string.atoi(name1[5:]) + try: + trackno = string.atoi(name1[5:]) + except strings.atoi_error: + print 'syntax error in ' + file + continue + if trackno > ntracks: + print 'track number ' + trackno + \ + ' in file ' + file + \ + ' out of range' + continue self.track[trackno] = value f.close() return self