Show More
@@ -199,13 +199,13 b' class ifileindextests(basetestcase):' | |||
|
199 | 199 | with self.assertRaises(error.LookupError): |
|
200 | 200 | f.lookup(hex(node)[0:12]) |
|
201 | 201 | |
|
202 |
with self.assertRaises( |
|
|
202 | with self.assertRaises(error.LookupError): | |
|
203 | 203 | f.lookup(-2) |
|
204 | 204 | |
|
205 | 205 | with self.assertRaises(error.LookupError): |
|
206 | 206 | f.lookup(b'-2') |
|
207 | 207 | |
|
208 |
with self.assertRaises( |
|
|
208 | with self.assertRaises(error.LookupError): | |
|
209 | 209 | f.lookup(1) |
|
210 | 210 | |
|
211 | 211 | with self.assertRaises(error.LookupError): |
@@ -121,7 +121,10 b' def fileidlookup(store, fileid, identifi' | |||
|
121 | 121 | Raises ``error.LookupError`` on failure. |
|
122 | 122 | """ |
|
123 | 123 | if isinstance(fileid, int): |
|
124 | return store.node(fileid) | |
|
124 | try: | |
|
125 | return store.node(fileid) | |
|
126 | except IndexError: | |
|
127 | raise error.LookupError(fileid, identifier, _('no match found')) | |
|
125 | 128 | |
|
126 | 129 | if len(fileid) == 20: |
|
127 | 130 | try: |
General Comments 0
You need to be logged in to leave comments.
Login now