Skip to content

Commit 7eea607

Browse files
hyobyunHyo Yul Byun
authored andcommitted
Fix Windows selection based python/sage selection run
1 parent 39d8c9d commit 7eea607

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/grammars/python.coffee

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
GrammarUtils = require '../grammar-utils'
2+
13
exports.Python =
24
'Selection Based':
35
command: 'python'
4-
args: (context) -> ['-u', '-c', context.getCode()]
6+
args: (context) ->
7+
code = context.getCode()
8+
tmpFile = GrammarUtils.createTempFileWithCode(code)
9+
return ['-u', tmpFile]
510

611
'File Based':
712
command: 'python'
@@ -12,7 +17,10 @@ exports.MagicPython = exports.Python
1217
exports.Sage =
1318
'Selection Based':
1419
command: 'sage'
15-
args: (context) -> ['-c', context.getCode()]
20+
args: (context) ->
21+
code = context.getCode()
22+
tmpFile = GrammarUtils.createTempFileWithCode(code)
23+
return [tmpFile]
1624

1725
'File Based':
1826
command: 'sage'

0 commit comments

Comments
 (0)