From bda526b202c0b5b25c3377d5f5159eb9d46e6373 Mon Sep 17 00:00:00 2001 From: Zach McDonough Date: Tue, 12 Jan 2021 09:26:46 -0800 Subject: [PATCH] Update pialert.py Add support for Python3 @ line 31 Fix case mismatch @ line 1216 --- back/pialert.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/back/pialert.py b/back/pialert.py index b1fa855e..f9823f76 100644 --- a/back/pialert.py +++ b/back/pialert.py @@ -28,7 +28,10 @@ import csv # CONFIG CONSTANTS #=============================================================================== PIALERT_PATH = os.path.dirname(os.path.abspath(__file__)) -execfile (PIALERT_PATH + "/pialert.conf") +if (sys.version_info > (3,0)): + exec(open(PIALERT_PATH + "/pialert.conf").read()) +else: + execfile (PIALERT_PATH + "/pialert.conf") #=============================================================================== @@ -1210,7 +1213,7 @@ def write_file (pPath, pText): file.close() else: file = open (pPath, 'w', encoding='utf-8') - file.write (ptext) + file.write (pText) file.close() #-------------------------------------------------------------------------------