Skip to content

Commit

Permalink
OD-1731: Don't store exceptions if we're not going to use them
Browse files Browse the repository at this point in the history
  • Loading branch information
hlieberman committed Nov 1, 2023
1 parent 94aa44e commit 564f453
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion efiction/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def fetch_coauthors(self, new_story, sql=None):
# get a dict of coauthor IDs for the story
try:
authors = sql.execute_and_fetchall(self.working_original, full_query)
except Exception as e:
except Exception:
authors = None
self.logger.info("No coauthors table...")
# We only try to operate on this result if it is not None
Expand Down
2 changes: 1 addition & 1 deletion efiction/tag_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def check_for_nonstandard_tag_tables(self) -> bool:
tags = list(map(lambda story_tags: story_tags[id_name].replace(',', ''), tags))
int(''.join(tags))
tag_tables[tag_table_name] = False
except Exception as e:
except Exception:
# Non-integer in identifier
tag_tables[tag_table_name] = True
except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion opendoors/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def read_table_to_dict(self, database: str, tablename: str):
try:
cursor.execute(f"SELECT * FROM {database}.{tablename};")
return cursor.fetchall()
except Exception as e:
except Exception:
self.logger.info(f"No table {tablename} in {database}...")
return []

Expand Down
2 changes: 1 addition & 1 deletion opendoors/progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def continue_from_last(config: ConfigParser, logger: Logger, sql: SqlDb, steps:
next_step = "01"
else:
run_next = False
except Exception as e:
except Exception:
logger.error(traceback.format_exc())


Expand Down
2 changes: 1 addition & 1 deletion opendoors/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def remove_output_files(path: str):
shutil.rmtree(file)
else:
os.remove(file)
except PermissionError as pe:
except PermissionError:
# We don't necessarily care that much
continue

Expand Down
2 changes: 1 addition & 1 deletion steps/tests/test_step_01.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def tearDown(self) -> None:
shutil.rmtree(file)
else:
os.remove(file)
except PermissionError as pe:
except PermissionError:
# We don't necessarily care that much
continue

Expand Down
2 changes: 1 addition & 1 deletion steps/tests/test_step_02.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def tearDown(self) -> None:
shutil.rmtree(file)
else:
os.remove(file)
except PermissionError as pe:
except PermissionError:
# We don't necessarily care that much
continue

Expand Down

0 comments on commit 564f453

Please sign in to comment.