in snapcraft plugin, direct import of BaseHandler causes problems
Bug #1547681 reported by
Chad Miller
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Fix Released
|
Medium
|
Sergio Schvezov |
Bug Description
The pluginhandler code searches module attrs for a value that is the likely plugin class.
If a user writes the plugin from scratch, they are likely to
"from snapcraft import BaseHandler" so they can later extend BaseHandler in their class.
About half the time, the pluginhandler iteration over module contents will find BaseHandler first and think it is the local code that is supposed to be the plugin implementation.
The pluginhandler "_get_plugin" function should test whether the value they are on is not BaseHandler before nominating it as the plugin.
Probably
if isinstance(attr, type) and issubclass(attr, snapcraft.
summary: |
- in plugin handler import of BaseHandler causes problems + in snapcraft plugin, direct import of BaseHandler causes problems |
Changed in snapcraft: | |
importance: | Undecided → Medium |
status: | New → Triaged |
milestone: | none → next |
assignee: | nobody → Sergio Schvezov (sergiusens) |
Changed in snapcraft: | |
status: | In Progress → Fix Committed |
Changed in snapcraft: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
https://github.com/ubuntu-core/snapcraft/pull/353