From d1c09af6fdbc56296c67b80993e5c327d8213286 Mon Sep 17 00:00:00 2001 From: volconst <20997907+volconst@users.noreply.github.com> Date: Fri, 5 Feb 2021 15:12:19 +0200 Subject: Fix printcore.runSmallScript The code tries to remove comments, but also removes the last character if no comments --- printrun/printcore.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/printrun/printcore.py b/printrun/printcore.py index ea209a7..eaa774d 100644 --- a/printrun/printcore.py +++ b/printrun/printcore.py @@ -514,13 +514,12 @@ class printcore(): # run a simple script if it exists, no multithreading def runSmallScript(self, filename): - if filename is None: return - f = None + if not filename: return try: with open(filename) as f: for i in f: l = i.replace("\n", "") - l = l[:l.find(";")] # remove comments + l = l.partition(';')[0] # remove comments self.send_now(l) except: pass -- cgit v1.2.3