diff options
author | kliment <kliment.yanev@gmail.com> | 2021-02-05 16:27:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-05 16:27:26 +0300 |
commit | b4647b59083ce0216205f4ae069524177091e222 (patch) | |
tree | 407bbe9aa5747033f05606207232c6dfafa5b925 | |
parent | 5d0ec6d25dd67fc51afccf028d4e77606ec81900 (diff) | |
parent | d1c09af6fdbc56296c67b80993e5c327d8213286 (diff) |
Merge pull request #1163 from volconst/fix-runSmallScript
Fix printcore.runSmallScript
-rw-r--r-- | printrun/printcore.py | 5 |
1 files 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 |