Skip to content

Commit

Permalink
Fix Python <3.7 startup warning
Browse files Browse the repository at this point in the history
- Fix bug where Python fails to return old version warning.
- Improve output for quicker debugging for people like me that have multiple
  ksconf and Pythons versions laying around.  ;-)
  • Loading branch information
lowell80 committed Apr 20, 2022
1 parent 784eee2 commit 07e404d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ksconf/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import sys

if sys.version_info < (3, 7): # noqa
from ksconf.consts import EXIT_CODE_BAD_PY_VERSION

# Can't actually import 'consts' because it loads 'enum'; so we cheat
EXIT_CODE_BAD_PY_VERSION = 121
sys.stderr.write(
Expand All @@ -33,6 +31,9 @@
"Releases 0.9.x support these older Python versions.\n\n"
"If you installed this with pip, try running:\n\n"
" pip install -U 'kintyre-splunk-conf>=0.9,<=0.10'\n")
sys.stderr.write("\nAdditional info\n"
" Python: {} {}\n"
" Ksconf: {}\n".format(sys.executable, sys.version_info[:3], sys.argv[0]))
sys.exit(EXIT_CODE_BAD_PY_VERSION)

from ksconf.cli import cli
Expand Down

0 comments on commit 07e404d

Please sign in to comment.