mirror of
https://github.com/python/cpython.git
synced 2025-11-09 22:16:39 +00:00
Added some error checking.
This commit is contained in:
parent
9bfef44d97
commit
8562c4cee6
2 changed files with 20 additions and 2 deletions
|
|
@ -87,7 +87,16 @@ class Cddb():
|
||||||
if self.toc != value:
|
if self.toc != value:
|
||||||
print 'toc\'s don\'t match'
|
print 'toc\'s don\'t match'
|
||||||
elif name1[:5] == 'track':
|
elif name1[:5] == 'track':
|
||||||
|
try:
|
||||||
trackno = string.atoi(name1[5:])
|
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
|
self.track[trackno] = value
|
||||||
f.close()
|
f.close()
|
||||||
return self
|
return self
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,16 @@ class Cddb():
|
||||||
if self.toc != value:
|
if self.toc != value:
|
||||||
print 'toc\'s don\'t match'
|
print 'toc\'s don\'t match'
|
||||||
elif name1[:5] == 'track':
|
elif name1[:5] == 'track':
|
||||||
|
try:
|
||||||
trackno = string.atoi(name1[5:])
|
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
|
self.track[trackno] = value
|
||||||
f.close()
|
f.close()
|
||||||
return self
|
return self
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue