Page MenuHomeSoftware Heritage

Simplify PackageLoader.load() using goto
AbandonedPublicDraft

Authored by vlorentz on Mar 26 2021, 12:23 PM.

Details

Reviewers
None
Group Reviewers
Reviewers
Summary
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'

Diff Detail

Event Timeline

Build has FAILED

Patch application report for D5351 (id=19180)

Rebasing onto a32f687151...

Current branch diff-target is up to date.
Changes applied before test
commit 0d9cd075d42e7a866eb4e340931ea44b04f85478
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Fri Mar 26 12:22:35 2021 +0100

    Simplify PackageLoader.load() using goto
    
    https://xkcd.com/292/

Link to build: https://jenkins.softwareheritage.org/job/DLDBASE/job/tests-on-diff/449/
See console output for more information: https://jenkins.softwareheritage.org/job/DLDBASE/job/tests-on-diff/449/console

Harbormaster returned this revision to the author for changes because remote builds failed.Mar 26 2021, 12:24 PM
Harbormaster failed remote builds in B20261: Diff 19180!