Stay compatible to Click 5.x

There could be some odd circumstances in development environments
leading to an older Click version being installed during an update restart,
so since it doesn't hurt as much to stay backwards compatible here, just
be it.
This commit is contained in:
Gina Häußge 2016-03-23 12:35:24 +01:00
parent a462f1ce3d
commit 084263d811

View file

@ -210,8 +210,12 @@ def main():
import sys
# os args are gained differently on win32
from click.utils import get_os_args
args = get_os_args()
try:
from click.utils import get_os_args
args = get_os_args()
except ImportError:
# for whatever reason we are running an older Click version?
args = sys.argv[1:]
if len(args) >= len(sys.argv):
# Now some ugly preprocessing of our arguments starts. We have a somewhat difficult situation on our hands