Update contrib/check-events for python 3
This commit is contained in:
parent
3177fc504f
commit
afdfbe4eed
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
@ -103,7 +103,7 @@ class EventVisitor(ast.NodeVisitor):
|
|||||||
if name in ('qubes.events.handler', 'qubes.ext.handler'):
|
if name in ('qubes.events.handler', 'qubes.ext.handler'):
|
||||||
# here we handle; event names (there may be more than one) are all
|
# here we handle; event names (there may be more than one) are all
|
||||||
# positional arguments
|
# positional arguments
|
||||||
if node.starargs is not None:
|
if any(isinstance(arg, ast.Starred) for arg in node.args):
|
||||||
raise AssertionError(
|
raise AssertionError(
|
||||||
'event handler with *args in {} +{}'.format(
|
'event handler with *args in {} +{}'.format(
|
||||||
self.filename, node.lineno))
|
self.filename, node.lineno))
|
||||||
|
Loading…
Reference in New Issue
Block a user