Skip to content

Commit 120063b

Browse files
committed
refine(opt): followup 8bd66ba
1 parent 25b128f commit 120063b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Python/compile.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ proc newCompilerUnit(st: SymTable,
9595
proc newCompiler(root: AsdlModl, fileName: PyStrObject): Compiler =
9696
result = new Compiler
9797
result.st = newSymTable(root)
98-
result.units.add(newCompilerUnit(result.st, root, newPyStr("<module>")))
98+
result.units.add(newCompilerUnit(result.st, root, newPyAscii"<module>"))
9999
result.fileName = fileName
100100

101101

@@ -713,7 +713,7 @@ compileMethod ListComp:
713713
let lineNo = astNode.lineNo.value
714714
assert astNode.generators.len == 1
715715
let genNode = AstComprehension(astNode.generators[0])
716-
c.units.add(newCompilerUnit(c.st, astNode, newPyStr("<listcomp>")))
716+
c.units.add(newCompilerUnit(c.st, astNode, newPyAscii"<listcomp>"))
717717
# empty list
718718
let body = newBasicBlock()
719719
let ending = newBasicBlock()

Python/cpython.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ proc parseCompileEval*(input: string, lexer: Lexer,
3737
rootCst = parseWithState(input, lexer, Mode.Single, rootCst)
3838
except SyntaxError:
3939
let e = SyntaxError(getCurrentException())
40-
let excpObj = fromBltinSyntaxError(e, newPyStr(Fstdin))
40+
let excpObj = fromBltinSyntaxError(e, newPyAscii(Fstdin))
4141
excpObj.printTb
4242
finished = true
4343
return true

Python/neval.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,13 +305,13 @@ proc evalFrame*(f: PyFrameObject): PyObject =
305305
handleException(reprObj)
306306

307307
# todo: optimization - build a cache
308-
let printFunction = PyNimFuncObject(bltinDict[newPyStr("print")])
308+
let printFunction = PyNimFuncObject(bltinDict[newPyAscii"print"])
309309
let retObj = tpMagic(NimFunc, call)(printFunction, @[reprObj])
310310
if retObj.isThrownException:
311311
handleException(retObj)
312312

313313
of OpCode.LoadBuildClass:
314-
sPush bltinDict[newPyStr("__build_class__")]
314+
sPush bltinDict[newPyAscii"__build_class__"]
315315

316316
of OpCode.ReturnValue:
317317
return sPop()

0 commit comments

Comments
 (0)