Commit 4968a283 authored by Andrew Gibiansky's avatar Andrew Gibiansky

make it work with python3

parent e6affe26
......@@ -24,7 +24,7 @@ import System.Argv0
import System.Directory
import qualified Filesystem.Path.CurrentOS as FS
import Data.List.Utils (split)
import Data.String.Utils (rstrip, endswith, strip)
import Data.String.Utils (rstrip, endswith, strip, replace)
import Text.Printf
import qualified System.IO.Strict as StrictIO
......@@ -245,8 +245,11 @@ buildIPython = do
pythonVersion :: Sh Text
pythonVersion = do
python <- path "python"
versions <- run python ["-c", "import sys; print sys.version_info.major, sys.version_info.minor"]
let [major, minor] = map read . split " " . strip $ unpack versions :: [Int]
versions <- run python ["-c", "import sys; print(sys.version_info.major, sys.version_info.minor)"]
let replacer = replace "(" "" .
replace ")" "" .
replace "," ""
let [major, minor] = map read . split " " . strip . replacer $ unpack versions :: [Int]
return $ "python" ++ pack (show major) ++ "." ++ pack (show minor)
-- | Check whether IPython is properly installed.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment