diff --git a/.flake8 b/.flake8 index 9df83dc..7e28a5f 100644 --- a/.flake8 +++ b/.flake8 @@ -32,7 +32,7 @@ max-line-length = 120 # Disable some rules for entire files per-file-ignores = # DALL000: Missing __all__, main isn't supposed to be imported - main.py: DALL000, run_db_scripts.py: DALL000, + main.py: DALL000, # DALL000: Missing __all__, Cogs aren't modules ./didier/cogs/*: DALL000, # DALL000: Missing __all__, tests aren't supposed to be imported diff --git a/run_db_scripts.py b/run_db_scripts.py index 55c5f2e..dbf325f 100644 --- a/run_db_scripts.py +++ b/run_db_scripts.py @@ -8,9 +8,7 @@ import importlib import sys from typing import Callable - -async def main(): - """Try to parse all command-line arguments into modules and run them sequentially""" +if __name__ == "__main__": scripts = sys.argv[1:] if not scripts: print("No scripts provided.", file=sys.stderr) @@ -22,12 +20,8 @@ async def main(): try: script_main: Callable = module.main - await script_main() + asyncio.run(script_main()) print(f"Successfully ran {script}") except AttributeError: print(f'Script "{script}" not found.', file=sys.stderr) exit(1) - - -if __name__ == "__main__": - asyncio.run(main())