Skip to content

Commit e72987b

Browse files
committed
Fix flake8 programming errors
1 parent 2092e85 commit e72987b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/test_sections.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def compare(tester, actual, expected):
2121
tester.assertEqual(only_in_expected, set())
2222
incorrect_values = []
2323
for key in actual_keys:
24-
if type(actual[key]) == Section:
24+
if isinstance(actual[key], Section):
2525
print("Calling `compare` again on {}".format(key))
2626
compare(tester, actual[key], expected[key])
2727
elif actual[key] != expected[key]:

zppy/utils.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def getTasks(config, section_name):
7373
username = os.environ.get("USER")
7474
for c in tasks:
7575
for key in c:
76-
if (type(c[key]) == str) and ("$USER" in c[key]):
76+
if isinstance(c[key], str) and ("$USER" in c[key]):
7777
c[key] = c[key].replace("$USER", username)
7878

7979
return tasks
@@ -82,9 +82,9 @@ def getTasks(config, section_name):
8282
# -----------------------------------------------------------------------------
8383
def get_active_status(task):
8484
active = task["active"]
85-
if type(active) == bool:
85+
if isinstance(active, bool):
8686
return active
87-
elif type(active) == str:
87+
elif isinstance(active, str):
8888
active_lower_case = active.lower()
8989
if active_lower_case == "true":
9090
return True
@@ -101,7 +101,7 @@ def get_active_status(task):
101101

102102

103103
def getYears(years_list):
104-
if type(years_list) == str:
104+
if isinstance(years_list, str):
105105
# This will be the case if years_list is missing a trailing comma
106106
years_list = [years_list]
107107
year_sets = []

0 commit comments

Comments
 (0)