This is an archive of the discontinued LLVM Phabricator instance.

[LNT] Python 3 support: Fix implicit package-relative imports
ClosedPublic

Authored by hubert.reinterpretcast on Sep 19 2019, 10:24 PM.

Details

Summary

This patch replaces implicit package-relative imports with explicitly relative imports and makes further adjustments necessary to correct for circular import issues encountered when running with Python 2.7 following the initial changes.

Finally, from __future__ import absolute_import is added to all of the files changed as part of this exercise.

These changes help with running tests (without result submission) with Python 3.

Diff Detail

Repository
rL LLVM

Event Timeline

MaskRay accepted this revision.Sep 19 2019, 10:34 PM
This revision is now accepted and ready to land.Sep 19 2019, 10:34 PM
thopre added inline comments.Sep 20 2019, 1:20 AM
lnt/server/db/testsuite.py
117 ↗(On Diff #220948)

I have a slightly different patch that breaks the circular dependency altogether by moving some things from testsuitedb to testsuite. From what I read online it is a better approach, as people seems to suggest local import to break circular dependencies is more of a workaround. I have no opinion myself.

hubert.reinterpretcast marked an inline comment as done.Sep 20 2019, 5:47 AM
hubert.reinterpretcast added inline comments.
lnt/server/db/testsuite.py
117 ↗(On Diff #220948)

Thanks. I agree this is more of a workaround. I see that you posted D67811 and indicated that you're open to rebasing after this patch lands. I think the effect would be a reduction in the size of your patch (which would help make it easier to review), so I'll work on committing this.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 20 2019, 8:24 AM