[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [craft] bin: Don't fail on empty line
From:       Hannah von Reth <null () kde ! org>
Date:       2018-09-27 9:16:58
Message-ID: E1g5SPq-0006I0-PR () code ! kde ! org
[Download RAW message or body]

Git commit 19292dc5c4dd470778408e48ce2cd2eb66e02ce4 by Hannah von Reth.
Committed on 27/09/2018 at 09:16.
Pushed by vonreth into branch 'master'.

Don't fail on empty line

M  +1    -1    bin/CraftSetupHelper.py

https://commits.kde.org/craft/19292dc5c4dd470778408e48ce2cd2eb66e02ce4

diff --git a/bin/CraftSetupHelper.py b/bin/CraftSetupHelper.py
index ae91fa42c..eac04e5d5 100644
--- a/bin/CraftSetupHelper.py
+++ b/bin/CraftSetupHelper.py
@@ -182,7 +182,7 @@ class SetupHelper(object):
 
     @staticmethod
     def stringToEnv(string : str):
-        for line in string.split("\n"):
+        for line in string.strip().split("\n"):
             kv = line.strip().split("=", 1)
             if len(kv) != 2:
                 raise Exception(f"Failed to parse environment variable: {line}")
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic