Skip to content

Conversation

@sciabarra
Copy link
Contributor

fixes #49

cmd += """
cd %s
exec python %s "$@"
exec "$(which python)" %s "$@"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test with an action to check that sys.executable is not empty?

Copy link
Member

@csantanapr csantanapr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@csantanapr
Copy link
Member

@sciabarra it looks like Travis is failing

@csantanapr
Copy link
Member

@sciabarra you need to fix your scalafmt. I tried to push the patch into your master branch but I don't have write access

--- a/tests/src/test/scala/runtime/actionContainers/PythonActionContainerTests.scala
+++ b/tests/src/test/scala/runtime/actionContainers/PythonActionContainerTests.scala
@@ -439,7 +439,6 @@ class PythonActionContainerTests extends BasicActionRunnerTests with WskActorSys
       })
   }

-
   it should "have a valid sys.executable" in {
     withActionContainer() { c =>
       val code =
@@ -449,12 +448,12 @@ class PythonActionContainerTests extends BasicActionRunnerTests with WskActorSys
           |    return { "sys": sys.executable }
         """.stripMargin

-        val (initCode, res) = c.init(initPayload(code))
-        initCode should be(200)
+      val (initCode, res) = c.init(initPayload(code))
+      initCode should be(200)

-        val (runCode, runRes) = c.run(runPayload(JsObject()))
-        runCode should be(200)
-        runRes.get.fields.get("sys").get.toString() should include("python")
+      val (runCode, runRes) = c.run(runPayload(JsObject()))
+      runCode should be(200)
+      runRes.get.fields.get("sys").get.toString() should include("python")
     }
   }
 }
--

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python 3.7 - sys.executable is empty

3 participants