Skip to content
Snippets Groups Projects
  1. Jun 29, 2023
  2. Jun 22, 2023
    • Mike Hommey's avatar
      Bug 1839263 - Don't derive assertRaisesFromLine from assertRaises.... · dfa753e4
      Mike Hommey authored
      Bug 1839263 - Don't derive assertRaisesFromLine from assertRaises. r=firefox-build-system-reviewers,ahochheiden, a=test-only DONTBUILD
      
      In python 3.11 (maybe also 3.10, I haven't tested that version ; 3.9 was
      definitely different), by the time the context manager comes back in our
      assertRaisesFromLine, the traceback is not available anymore (or yet,
      I'm not entirely sure which way it does) to inspect and check the line
      numbers we want to check.
      
      And while assertRaises exposes the thrown exception in its `exception`
      attribute, it also resets the traceback associated with it, so we can't
      find it there either.
      
      So instead, we implement our own context manager for
      assertRaisesFromLine such that we can access that traceback.
      
      Differential Revision: https://phabricator.services.mozilla.com/D181425
      dfa753e4
    • Mike Hommey's avatar
      Bug 1839263 - Fix python configure lint on python >= 3.10.... · 0f09a132
      Mike Hommey authored
      Bug 1839263 - Fix python configure lint on python >= 3.10. r=firefox-build-system-reviewers,ahochheiden,sergesanspaille, a=test-only DONTBUILD
      
      Python 3.10 added some more arguments to the CodeTypes constructor. It
      also changed co_lnotab to co_linetables.
      
      We were using co_lnotab to simulate a function with a def at a specific
      line and a raise at a specific other line. I'm not sure how I ended up
      with this particular requirement (this may have been related to python 2
      still being used back then), but as of now, it doesn't seem we need the
      def to be at a specific location, so we can avoid needing to generate
      a co_linetables/co_lnotab, relying instead on the raise expression being
      on the co_firstlineno+1 in the thrower function.
      
      As for the extra arguments, it turns out python 3.8 also introduced a
      CodeType.replace method that can be used to derive a CodeType object
      from another, which is certainly simpler than calling its construtor
      with the right set of arguments.
      
      Differential Revision: https://phabricator.services.mozilla.com/D181424
      0f09a132
  3. Jul 27, 2023
  4. Feb 05, 2024
  5. Nov 29, 2023
  6. Dec 12, 2023
  7. Jan 03, 2024
  8. Dec 14, 2023
  9. Sep 18, 2023
  10. Jun 07, 2023
  11. Jul 07, 2023
  12. Jun 28, 2023
  13. Jun 13, 2023
  14. Jun 09, 2023
  15. Jun 02, 2023
  16. Jun 01, 2023
  17. May 31, 2023
  18. May 30, 2023
  19. May 29, 2023
  20. May 26, 2023
  21. May 25, 2023
  22. May 24, 2023
  23. May 23, 2023
Loading