1
0
Fork 0
mirror of synced 2024-06-29 03:20:58 +12:00

fix lgtm alerts

This commit is contained in:
Nick Sweeting 2021-04-06 13:47:26 -04:00
parent 21bb84f627
commit 2c07d8f1f3
2 changed files with 3 additions and 5 deletions

View file

@ -502,7 +502,7 @@ def write_config_file(config: Dict[str, str], out_dir: str=None) -> ConfigDict:
key.upper(): CONFIG.get(key.upper()) key.upper(): CONFIG.get(key.upper())
for key in config.keys() for key in config.keys()
} }
except: except BaseException:
# something went horribly wrong, rever to the previous version # something went horribly wrong, rever to the previous version
with open(f'{config_path}.bak', 'r', encoding='utf-8') as old: with open(f'{config_path}.bak', 'r', encoding='utf-8') as old:
atomic_write(config_path, old.read()) atomic_write(config_path, old.read())
@ -547,7 +547,7 @@ def load_config(defaults: ConfigDefaultDict,
stderr(' For config documentation and examples see:') stderr(' For config documentation and examples see:')
stderr(' https://github.com/ArchiveBox/ArchiveBox/wiki/Configuration') stderr(' https://github.com/ArchiveBox/ArchiveBox/wiki/Configuration')
stderr() stderr()
raise # raise
raise SystemExit(2) raise SystemExit(2)
return extended_config return extended_config
@ -1067,7 +1067,6 @@ def setup_django(out_dir: Path=None, check_db=False, config: ConfigDict=CONFIG,
assert isinstance(output_dir, Path) and isinstance(config['PACKAGE_DIR'], Path) assert isinstance(output_dir, Path) and isinstance(config['PACKAGE_DIR'], Path)
try: try:
import django
from django.core.management import call_command from django.core.management import call_command
sys.path.append(str(config['PACKAGE_DIR'])) sys.path.append(str(config['PACKAGE_DIR']))

View file

@ -157,7 +157,7 @@ class TimedProgress:
# kill the progress bar subprocess # kill the progress bar subprocess
try: try:
self.p.close() # must be closed *before* its terminnated self.p.close() # must be closed *before* its terminnated
except: except BaseException:
pass pass
self.p.terminate() self.p.terminate()
self.p.join() self.p.join()
@ -223,7 +223,6 @@ def progress_bar(seconds: int, prefix: str='') -> None:
# sys.stdout.flush() # sys.stdout.flush()
except (KeyboardInterrupt, BrokenPipeError): except (KeyboardInterrupt, BrokenPipeError):
print() print()
pass
def log_cli_command(subcommand: str, subcommand_args: List[str], stdin: Optional[str], pwd: str): def log_cli_command(subcommand: str, subcommand_args: List[str], stdin: Optional[str], pwd: str):