mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-09 04:50:37 +00:00
Using `pyupgrade` to get all `partners` code up to 3.9 standards (mostly, fixing old `typing` imports).
20 lines
517 B
Python
20 lines
517 B
Python
"""load multiple Python files specified as command line arguments."""
|
|
|
|
import sys
|
|
import traceback
|
|
from importlib.machinery import SourceFileLoader
|
|
|
|
if __name__ == "__main__":
|
|
files = sys.argv[1:]
|
|
has_failure = False
|
|
for file in files:
|
|
try:
|
|
SourceFileLoader("x", file).load_module()
|
|
except Exception:
|
|
has_failure = True
|
|
print(file) # noqa: T201
|
|
traceback.print_exc()
|
|
print() # noqa: T201
|
|
|
|
sys.exit(1 if has_failure else 0)
|