Scap plugins: Tidy up imports for py3 transition
ClosedPublic

Authored by demon on May 3 2018, 8:21 PM.

Details

Reviewers
mmodell
thcipriani
Group Reviewers
Release-Engineering-Team
Commits
rMSCA0e22bcfb50c4: Scap plugins: Tidy up imports for py3 transition
Patch without arc
git checkout -b D1041 && curl -L https://phabricator.wikimedia.org/D1041?download=true | git apply
Summary

Python3 actually calls for using 'from . import bar' syntax for imports. This seems weird, as Python is not known for verbosity being a guiding trait. But when you think about it, it makes sense. When importing via ./.., you're making it completely explicit as to what module you're wanting to load. The one relative to your current file. So let's start moving there (and in fact, is what absolute_imports helps you when you get wrong).

Step 1: plugins.

While we're here, fix some lambda/list comprehension. It's not wrong as-is, but is easier to read and doesn't trigger idomatic warnings

Diff Detail

Repository
rMSCA Scap
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
demon created this revision.May 3 2018, 8:21 PM
Restricted Application added a reviewer: mmodell. · View Herald TranscriptMay 3 2018, 8:21 PM
Restricted Application added a reviewer: Release-Engineering-Team. · View Herald Transcript
Restricted Application added a project: Release-Engineering-Team. · View Herald Transcript
demon requested review of this revision.May 3 2018, 8:25 PM
thcipriani accepted this revision.May 4 2018, 6:58 PM
thcipriani added a subscriber: thcipriani.

scap say still seems to work

scap/plugins/say.py
141

is list now superfluous?

This revision is now accepted and ready to land.May 4 2018, 6:58 PM
demon updated this revision to Diff 2747.May 4 2018, 7:00 PM
  • Remove superfluous list() call
demon marked an inline comment as done.May 4 2018, 7:00 PM
This revision was automatically updated to reflect the committed changes.