Make sure sys.argv exists (#5943)

* Make sure sys.argv exists (resolves #5610)

* Fix typo
This commit is contained in:
Ines Montani 2020-08-20 16:30:11 +02:00 committed by GitHub
parent 071c09ff35
commit 99d2a25687
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -193,7 +193,7 @@ def setup_package():
root = os.path.abspath(os.path.dirname(__file__)) root = os.path.abspath(os.path.dirname(__file__))
if len(sys.argv) > 1 and sys.argv[1] == "clean": if hasattr(sys, "argv") and len(sys.argv) > 1 and sys.argv[1] == "clean":
return clean(root) return clean(root)
with chdir(root): with chdir(root):