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