diff --git a/utbot-python/src/main/kotlin/org/utbot/python/framework/codegen/utils/StringUtils.kt b/utbot-python/src/main/kotlin/org/utbot/python/framework/codegen/utils/StringUtils.kt index 409b7acc85..40f3b5b831 100644 --- a/utbot-python/src/main/kotlin/org/utbot/python/framework/codegen/utils/StringUtils.kt +++ b/utbot-python/src/main/kotlin/org/utbot/python/framework/codegen/utils/StringUtils.kt @@ -4,5 +4,9 @@ import java.nio.file.FileSystems fun String.toRelativeRawPath(): String { - return "os.path.dirname(__file__) + r'${FileSystems.getDefault().separator}${this}'" + val dirname = "os.path.dirname(__file__)" + if (this.isEmpty()) { + return dirname + } + return "$dirname + r'${FileSystems.getDefault().separator}${this}'" } \ No newline at end of file