Closed Bug 1441484 Opened 4 years ago Closed 4 years ago

NameError in make_incremental_updates.py "global name 'exc' is not defined"

Categories

(Release Engineering :: Release Automation: Other, defect)

defect
Not set
normal

Tracking

(firefox60 fixed)

RESOLVED FIXED
Tracking Status
firefox60 --- fixed

People

(Reporter: jcristau, Assigned: jcristau)

References

Details

Attachments

(1 file)

In bug 1385780, "except Exception, exc" was replaced by "except Exception(exc)" instead of "except Exception as exc".
See Also: → 1438839
Attachment #8954306 - Flags: review?(bhearsum)
Assignee: sledru → jcristau
Comment on attachment 8954306 [details]
Bug 1441484 - fix error handling in make_incremental_updates.

https://reviewboard.mozilla.org/r/223428/#review229548

::: tools/update-packaging/test_make_incremental_updates.py:149
(Diff revision 1)
>  
>      def test_decode_filename(self):
>          expected = {'locale': 'lang', 'platform': 'platform', 'product': 'product', 'version': '1.0', 'type': 'complete'}
>          self.assertEquals(expected, mkup.decode_filename('product-1.0.lang.platform.complete.mar'))
>          self.assertRaises(Exception, mkup.decode_filename, 'fail')
> +        self.assertEquals(expected, mkup.decode_filename('platform/lang/product-1.0.complete.mar'))

The other way to make this test catch it is to raise a better exception and/or catch a more specific error message. This is fine though - thank you!
Attachment #8954306 - Flags: review?(bhearsum) → review+
Comment on attachment 8954306 [details]
Bug 1441484 - fix error handling in make_incremental_updates.

https://reviewboard.mozilla.org/r/223428/#review229548

> The other way to make this test catch it is to raise a better exception and/or catch a more specific error message. This is fine though - thank you!

I actually wrote this initially:

-        self.assertRaises(Exception, mkup.decode_filename, 'fail')
+        with self.assertRaises(Exception) as cm:
+            mkup.decode_filename('fail')
+        self.assertTrue(cm.exception.args[0].startswith('could not parse filepath fail:'))

Wasn't sure if it was worth it, but I can pull that back in.
Pushed by jcristau@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/179c83a1d28b
fix error handling in make_incremental_updates.  r=bhearsum
https://hg.mozilla.org/mozilla-central/rev/179c83a1d28b
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.