Skip to content

Commit b4c60c6

Browse files
committed
Fix error with list vs string handling in conversion
1 parent 64a2e02 commit b4c60c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sasctl/utils/modelMigration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ def convertScoreCode(zPath, scoreResource, pythonScoreCode):
114114
parsedOldString = parsedOldString + stringFound
115115
if stringFound:
116116
newString.append("settings.pickle_path + '{}'".format(resource))
117-
for oldStr in parsedOldString:
118-
scoreCode = scoreCode.replace(oldStr, newString)
117+
for old, new in zip(parsedOldString, newString):
118+
scoreCode = scoreCode.replace(str(old), str(new))
119119

120120
# Write new text of score code to file
121121
with open(Path(zPath) / pythonScoreCode, "w") as pyFile:

0 commit comments

Comments
 (0)