62 | | while minfile[pos] == eofchar : |
63 | | pos -= 1 |
64 | | idbyte = minfile[pos] |
65 | | if idbyte != minfile[1] : |
66 | | raise IndexError, "Invalid DVI file." |
67 | | pos = unpack(">I", minfile[pos - 4:pos])[0] |
68 | | if minfile[pos] != postchar : |
69 | | raise IndexError, "Invalid DVI file." |
70 | | pagecount = unpack(">H", minfile[pos + 27: pos + 29])[0] |
71 | | except IndexError : # EOF ? |
72 | | pass |
73 | | minfile.close() # reached EOF |
| 62 | try : |
| 63 | while minfile[pos] == eofchar : |
| 64 | pos -= 1 |
| 65 | idbyte = minfile[pos] |
| 66 | if idbyte != minfile[1] : |
| 67 | raise IndexError, "Invalid DVI file." |
| 68 | pos = unpack(">I", minfile[pos - 4:pos])[0] |
| 69 | if minfile[pos] != postchar : |
| 70 | raise IndexError, "Invalid DVI file." |
| 71 | pagecount = unpack(">H", minfile[pos + 27: pos + 29])[0] |
| 72 | except IndexError : # EOF ? |
| 73 | pass |
| 74 | finally : |
| 75 | minfile.close() # reached EOF |