From b4e4008f79ee3e08fb926e07e292b037491407c8 Mon Sep 17 00:00:00 2001 From: Mark Peek Date: Sat, 20 Mar 2021 10:32:52 -0700 Subject: [PATCH] Update Python3 changes per review feedback --- awacs/__init__.py | 6 +++--- tests/test_examples.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/awacs/__init__.py b/awacs/__init__.py index e85d8058..049d5b94 100644 --- a/awacs/__init__.py +++ b/awacs/__init__.py @@ -13,12 +13,12 @@ valid_names = re.compile(r'^[a-zA-Z0-9]+$') -class AWSObject(object): +class AWSObject: def __init__(self, name, type=None, dictname=None, props={}, **kwargs): self.name = name self.props = props # Cache the keys for validity checks - self.propnames = list(props.keys()) + self.propnames = props.keys() # unset/None is also legal if name and not valid_names.match(name): @@ -131,7 +131,7 @@ def __init__(self, **kwargs): sup.__init__(None, props=self.props, **kwargs) -class AWSHelperFn(object): +class AWSHelperFn: def getdata(self, data): if isinstance(data, AWSObject): return data.name diff --git a/tests/test_examples.py b/tests/test_examples.py index 49a982a1..7071cfbb 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -27,7 +27,7 @@ def add_tests(): # Filter out all *.py files from the examples directory examples = 'examples' regex = re.compile(r'.py$', re.I) - example_filesnames = list(filter(regex.search, os.listdir(examples))) + example_filesnames = filter(regex.search, os.listdir(examples)) # Add new test functions to the TestExamples class for f in example_filesnames: