Update python code for python 3.8 or higher compatibility
Changes:
- Update shebang directive to use python3 explicitly.
- remove preexec_fn feature which is deprecated in higher
python version 3.8 and above.
- bufsize fix, from documentation bufsize 1 means line buffered
(only usable if universal_newlines=True i.e., in a text mode)
refer: https://docs.python.org/3/library/subprocess.html
- Fix SyntaxWarning: "is" with "=="
Change-Id: Ib96c1ba8c2327d6774d0d731b48ca7e61a4a297a
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/gen_call_robot.py b/lib/gen_call_robot.py
index 62ea130..2e51626 100755
--- a/lib/gen_call_robot.py
+++ b/lib/gen_call_robot.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
r"""
This module provides functions which are useful to plug-ins call-point programs that wish to make external
@@ -359,7 +359,7 @@
# It TMP_ROBOT_DIR_PATH is set, it means the caller wanted the robot output initially directed to
# TMP_ROBOT_DIR_PATH but later moved to FFDC_DIR_PATH. Otherwise, we're done.
- if os.environ.get("TMP_ROBOT_DIR_PATH", "") is "":
+ if os.environ.get("TMP_ROBOT_DIR_PATH", "") == "":
return
# We're directing these to the FFDC dir path so that they'll be subjected to FFDC cleanup.