From cfdee09a0bdf5f57be8239838d5d6cbe3a2d4a51 Mon Sep 17 00:00:00 2001 From: Daniel O'Brien Date: Tue, 28 Apr 2020 18:08:33 -0400 Subject: [PATCH] Fix for Python 2 version check. `sys.version_info.major` and `sys.version_info.minor` are only available as of Python 3 so previously this check failed in an un-graceful way. This change adds previous index-based checks back, which should be compatible with both Python 2 and 3. --- bin/pdagentd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/pdagentd.py b/bin/pdagentd.py index 8d7f7b93..8ed5fd1c 100755 --- a/bin/pdagentd.py +++ b/bin/pdagentd.py @@ -57,7 +57,7 @@ ) # Check Python version. -if sys.version_info.major == 2 and sys.version_info.minor < 7: +if sys.version_info[0] == 2 and sys.version_info[1] < 7: raise SystemExit( "Agent requires Python version 2.7 or higher.\n" + "Agent will now quit"