Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Renaming ensuringUtf() to toUnicode()
  • Loading branch information
RockyRoad29 committed Jan 15, 2016
commit 54924c5ccd1835bf56ee54f96d7dda1890c31ee3
10 changes: 5 additions & 5 deletions py-src/ltmain.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def asUnicode(s):
except:
return str(s)

def ensureUtf(s, encoding='utf8'):
def toUnicode(s, encoding='utf8'):
"""Converts input to unicode if necessary.

If `s` is bytes, it will be decoded using the `encoding` parameters.
Expand Down Expand Up @@ -200,11 +200,11 @@ def handleEval(data):
loc = form[0]
isEval = False
try:
code= compile(ensureUtf(code), ensureUtf(data[2]["name"]), 'eval')
code= compile(toUnicode(code), ensureUtf(data[2]["name"]), 'eval')
isEval = True
except:
try:
code= compile(ensureUtf(code), ensureUtf(data[2]["name"]), 'exec')
code= compile(toUnicode(code), ensureUtf(data[2]["name"]), 'exec')
except:
e = traceback.format_exc()
send(data[0], "editor.eval.python.exception", {"ex": cleanTrace(e), "meta": loc})
Expand Down Expand Up @@ -270,11 +270,11 @@ def ipyEval(data):
loc = form[0]
isEval = False
try:
compile(ensureUtf(code), ensureUtf(data[2]["name"]), 'eval')
compile(toUnicode(code), ensureUtf(data[2]["name"]), 'eval')
isEval = True
except:
try:
compile(ensureUtf(code), ensureUtf(data[2]["name"]), 'exec')
compile(toUnicode(code), ensureUtf(data[2]["name"]), 'exec')
except:
e = traceback.format_exc()
send(data[0], "editor.eval.python.exception", {"ex": cleanTrace(e), "meta": loc})
Expand Down