Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Commit 54924c5

Browse files
committed
Renaming ensuringUtf() to toUnicode()
1 parent 9be4ce1 commit 54924c5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

py-src/ltmain.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def asUnicode(s):
4646
except:
4747
return str(s)
4848

49-
def ensureUtf(s, encoding='utf8'):
49+
def toUnicode(s, encoding='utf8'):
5050
"""Converts input to unicode if necessary.
5151
5252
If `s` is bytes, it will be decoded using the `encoding` parameters.
@@ -200,11 +200,11 @@ def handleEval(data):
200200
loc = form[0]
201201
isEval = False
202202
try:
203-
code= compile(ensureUtf(code), ensureUtf(data[2]["name"]), 'eval')
203+
code= compile(toUnicode(code), ensureUtf(data[2]["name"]), 'eval')
204204
isEval = True
205205
except:
206206
try:
207-
code= compile(ensureUtf(code), ensureUtf(data[2]["name"]), 'exec')
207+
code= compile(toUnicode(code), ensureUtf(data[2]["name"]), 'exec')
208208
except:
209209
e = traceback.format_exc()
210210
send(data[0], "editor.eval.python.exception", {"ex": cleanTrace(e), "meta": loc})
@@ -270,11 +270,11 @@ def ipyEval(data):
270270
loc = form[0]
271271
isEval = False
272272
try:
273-
compile(ensureUtf(code), ensureUtf(data[2]["name"]), 'eval')
273+
compile(toUnicode(code), ensureUtf(data[2]["name"]), 'eval')
274274
isEval = True
275275
except:
276276
try:
277-
compile(ensureUtf(code), ensureUtf(data[2]["name"]), 'exec')
277+
compile(toUnicode(code), ensureUtf(data[2]["name"]), 'exec')
278278
except:
279279
e = traceback.format_exc()
280280
send(data[0], "editor.eval.python.exception", {"ex": cleanTrace(e), "meta": loc})

0 commit comments

Comments
 (0)