Skip to content

Commit e542a9b

Browse files
committed
Move _ to a better place
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent 47d5a49 commit e542a9b

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

bpython/curtsiesfrontend/repl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,7 @@ def show_source(self):
13591359
try:
13601360
source = self.get_source_of_current_name()
13611361
except SourceNotFound as e:
1362-
self.status_bar.message(_(str(e)))
1362+
self.status_bar.message(str(e))
13631363
else:
13641364
if self.config.highlight_show_source:
13651365
source = format(PythonLexer().get_tokens(source),

bpython/repl.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,19 +468,19 @@ def get_source_of_current_name(self):
468468
if obj is None:
469469
line = self.current_line
470470
if not line.strip():
471-
raise SourceNotFound("Nothing to get source of")
471+
raise SourceNotFound(_("Nothing to get source of"))
472472
if inspection.is_eval_safe_name(line):
473473
obj = self.get_object(line)
474474
return inspect.getsource(obj)
475475
except (AttributeError, NameError) as e:
476-
msg = "Cannot get source: " + str(e)
476+
msg = _("Cannot get source: %s") % (str(e), )
477477
except IOError as e:
478478
msg = str(e)
479479
except TypeError as e:
480480
if "built-in" in str(e):
481-
msg = "Cannot access source of %r" % (obj, )
481+
msg = _("Cannot access source of %r") % (obj, )
482482
else:
483-
msg = "No source code found for %s" % (self.current_line, )
483+
msg = _("No source code found for %s") % (self.current_line, )
484484
raise SourceNotFound(msg)
485485

486486
def set_docstring(self):

0 commit comments

Comments
 (0)