Skip to content

Commit

Permalink
modified some errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsudukim committed May 12, 2015
1 parent ed46047 commit 3f9a188
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ package org.apache.spark.deploy

import java.net.URI
import java.io.File
import scala.util.Try

import scala.collection.mutable.ArrayBuffer
import scala.collection.JavaConversions._
import scala.util.Try

import org.apache.spark.api.python.PythonUtils
import org.apache.spark.util.{RedirectThread, Utils}
Expand Down Expand Up @@ -98,7 +98,7 @@ object PythonRunner {

// In Windows, the drive should not be prefixed with "/"
// For instance, python does not understand "/C:/path/to/sheep.py"
if (formattedPath.matches("/[a-zA-Z]:/.*")) {
if (Utils.isWindows && formattedPath.matches("/[a-zA-Z]:/.*")) {
formattedPath = formattedPath.stripPrefix("/")
}
formattedPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.spark.deploy

import org.scalatest.FunSuite

import org.apache.spark.util.Utils

class PythonRunnerSuite extends FunSuite {
Expand All @@ -29,9 +30,9 @@ class PythonRunnerSuite extends FunSuite {
assert(PythonRunner.formatPath("file:///spark.py") === "/spark.py")
assert(PythonRunner.formatPath("local:/spark.py") === "/spark.py")
assert(PythonRunner.formatPath("local:///spark.py") === "/spark.py")
assert(PythonRunner.formatPath("file:/C:/a/b/spark.py", testWindows = true) ===
"C:/a/b/spark.py")
if (Utils.isWindows) {
assert(PythonRunner.formatPath("file:/C:/a/b/spark.py", testWindows = true) ===
"C:/a/b/spark.py")
assert(PythonRunner.formatPath("C:\\a\\b\\spark.py", testWindows = true) ===
"C:/a/b/spark.py")
assert(PythonRunner.formatPath("C:\\a b\\spark.py", testWindows = true) ===
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class SparkILoop(
SparkILoop.getAddedJars.map { jar => new URI(jar).getPath.stripPrefix("/") }
} else {
// We need new URI(jar).getPath here for the case that `jar` includes encoded white space (%20).
SparkILoop.getAddedJars.map { jar => new URI(jar).getPath}
SparkILoop.getAddedJars.map { jar => new URI(jar).getPath }
}
// work around for Scala bug
val totalClassPath = addedJars.foldLeft(
Expand Down

0 comments on commit 3f9a188

Please sign in to comment.