Skip to content

Commit

Permalink
Use Python 3 way to call super()
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-k authored and markpeek committed Mar 27, 2021
1 parent 1066ad9 commit e405627
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
3 changes: 1 addition & 2 deletions awacs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ class AWSProperty(AWSObject):
"""

def __init__(self, **kwargs):
sup = super(AWSProperty, self)
sup.__init__(None, props=self.props, **kwargs)
super().__init__(None, props=self.props, **kwargs)


class AWSHelperFn:
Expand Down
5 changes: 2 additions & 3 deletions awacs/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def JSONrepr(self):

class ARN(BaseARN):
def __init__(self, service, resource, region="", account=""):
super(ARN, self).__init__(service, resource, region, account)
super().__init__(service, resource, region, account)
warnings.warn(
"This is going away. Either use a service specific "
"ARN class, or use the BaseARN class.",
Expand Down Expand Up @@ -160,8 +160,7 @@ def JSONrepr(self):

class AWSPrincipal(Principal):
def __init__(self, principals):
sup = super(AWSPrincipal, self)
sup.__init__("AWS", principals)
super().__init__("AWS", principals)


def effect(x):
Expand Down
14 changes: 6 additions & 8 deletions scrape/scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,27 @@
CLASSES = """\
class Action(BaseAction):
def __init__(self, action=None):
sup = super(Action, self)
sup.__init__(prefix, action)
super().__init__(prefix, action)
class ARN(BaseARN):
def __init__(self, resource="", region="", account=""):
sup = super(ARN, self)
sup.__init__(service=prefix, resource=resource, region=region, account=account)
super().__init__(
service=prefix, resource=resource, region=region, account=account
)
"""

CLASSES_S3 = """\
class Action(BaseAction):
def __init__(self, action=None):
sup = super(Action, self)
sup.__init__(prefix, action)
super().__init__(prefix, action)
class ARN(BaseARN):
def __init__(self, resource="", region="", account=""):
sup = super(ARN, self)
# account is empty for S3
account = ""
sup.__init__(service=prefix, resource=resource, region=region, account=account)
super().__init__(service=prefix, resource=resource, region=region, account="")
"""

BASEDIR = "awacs"
Expand Down

0 comments on commit e405627

Please sign in to comment.