Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit30f943f

Browse files
committed
Replace str(e) with "%s" % e where possible (fixes#501)
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent25c2fe0 commit30f943f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎bpython/curtsiesfrontend/repl.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ def process_control_event(self, e):
562562
self.startup()
563563
exceptIOErrorase:
564564
self.status_bar.message(
565-
_('Executing PYTHONSTARTUP failed: %s')% (str(e)))
565+
_('Executing PYTHONSTARTUP failed: %s')% (e,))
566566

567567
elifisinstance(e,bpythonevents.UndoEvent):
568568
self.undo(n=e.n)
@@ -1532,7 +1532,7 @@ def show_source(self):
15321532
try:
15331533
source=self.get_source_of_current_name()
15341534
exceptSourceNotFoundase:
1535-
self.status_bar.message(str(e))
1535+
self.status_bar.message('%s'% (e,))
15361536
else:
15371537
ifself.config.highlight_show_source:
15381538
source=format(PythonLexer().get_tokens(source),

‎bpython/repl.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -545,11 +545,11 @@ def get_source_of_current_name(self):
545545
obj=self.get_object(line)
546546
returninspection.get_source_unicode(obj)
547547
except (AttributeError,NameError)ase:
548-
msg=_("Cannot get source: %s")% (str(e), )
548+
msg=_(u"Cannot get source: %s")% (e, )
549549
exceptIOErrorase:
550-
msg=str(e)
550+
msg=u"%s"% (e,)
551551
exceptTypeErrorase:
552-
if"built-in"instr(e):
552+
if"built-in"inu"%s"% (e,):
553553
msg=_("Cannot access source of %r")% (obj, )
554554
else:
555555
msg=_("No source code found for %s")% (self.current_line, )

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp