Skip to content
Snippets Groups Projects

Simplify PackageLoader.load() using goto

https://xkcd.com/292/

Test Plan

It does not work (because of pytest?) :(

../../.local/lib/python3.7/site-packages/_pytest/assertion/rewrite.py:170: in exec_module
    exec(co, module.__dict__)
swh/loader/package/loader.py:144: in <module>
    class PackageLoader(BaseLoader, Generic[TPackageInfo]):
swh/loader/package/loader.py:469: in PackageLoader
    def load(self) -> Dict:
../../.local/lib/python3.7/site-packages/goto.py:184: in with_goto
    _patch_code(func_or_code.__code__),
../../.local/lib/python3.7/site-packages/goto.py:156: in _patch_code
    raise SyntaxError('Unknown label {0!r}'.format(code.co_names[label]))
E     File "<string>", line None
E   SyntaxError: Unknown label 'fail'

Migrated from D5351 (view on Phabricator)

Merge request reports

Approval is optional

Closed by Phabricator Migration userPhabricator Migration user 4 years ago (Mar 26, 2021 11:55am UTC)

Merge details

  • The changes were not merged into .

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading