Skip to content

Commit

Permalink
Fix flake8 programming errors
Browse files Browse the repository at this point in the history
  • Loading branch information
altheaden committed Oct 14, 2024
1 parent 7bd5218 commit 4d0d985
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/test_sections.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def compare(tester, actual, expected):
tester.assertEqual(only_in_expected, set())
incorrect_values = []
for key in actual_keys:
if type(actual[key]) == Section:
if isinstance(actual[key], Section):
print("Calling `compare` again on {}".format(key))
compare(tester, actual[key], expected[key])
elif actual[key] != expected[key]:
Expand Down
8 changes: 4 additions & 4 deletions zppy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ class DependencySkipError(RuntimeError):

def get_active_status(task: Dict[str, Any]) -> bool:
active: Any = task["active"]
if type(active) == bool:
if isinstance(active, bool):
return active
elif type(active) == str:
elif isinstance(active, str):
active_lower_case: str = active.lower()
if active_lower_case == "true":
return True
Expand Down Expand Up @@ -151,7 +151,7 @@ def get_tasks(config: ConfigObj, section_name: str) -> List[Dict[str, Any]]:
username = os.environ.get("USER")
for c in tasks:
for key in c:
if (type(c[key]) == str) and ("$USER" in c[key]):
if (isinstance(c[key], str)) and ("$USER" in c[key]):
c[key] = c[key].replace("$USER", username)

return tasks
Expand Down Expand Up @@ -242,7 +242,7 @@ def check_required_parameters(
# "year_begin-year_end"
def get_years(years_input) -> List[Tuple[int, int]]:
years_list: List[str]
if type(years_input) == str:
if isinstance(years_input, str):
# This will be the case if years_list is missing a trailing comma
years_list = [years_input]
else:
Expand Down

0 comments on commit 4d0d985

Please sign in to comment.