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

Commit7eaef53

Browse files
committed
Remove more calls to str
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent834ffa0 commit7eaef53

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

‎bpython/config.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def fill_config_with_default_values(config, default_values):
5555

5656
for (opt,val)initeritems(default_values[section]):
5757
ifnotconfig.has_option(section,opt):
58-
config.set(section,opt,str(val))
58+
config.set(section,opt,'%s'%(val,))
5959

6060

6161
defloadini(struct,configfile):

‎bpython/repl.py‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -717,8 +717,7 @@ def write2file(self):
717717
withopen(fn,mode)asf:
718718
f.write(s)
719719
exceptIOErrorase:
720-
self.interact.notify(_("Error writing file '%s': %s")% (fn,
721-
str(e)))
720+
self.interact.notify(_("Error writing file '%s': %s")% (fn,e))
722721
else:
723722
self.interact.notify(_('Saved to %s.')% (fn, ))
724723

@@ -778,7 +777,7 @@ def do_pastebin_json(self, s):
778777
response=requests.post(url,data=payload,verify=True)
779778
response.raise_for_status()
780779
exceptrequests.exceptions.RequestExceptionasexc:
781-
self.interact.notify(_('Upload failed: %s')% (str(exc), ))
780+
self.interact.notify(_('Upload failed: %s')% (exc, ))
782781
return
783782

784783
self.prev_pastebin_content=s
@@ -866,7 +865,7 @@ def insert_into_history(self, s):
866865
self.rl_history.append_reload_and_write(s,self.config.hist_file,
867866
getpreferredencoding())
868867
exceptRuntimeErrorase:
869-
self.interact.notify(str(e))
868+
self.interact.notify(u"%s"% (e,))
870869

871870
defprompt_undo(self):
872871
"""Returns how many lines to undo, 0 means don't undo"""
@@ -1081,7 +1080,7 @@ def edit_config(self):
10811080
f.write(default_config)
10821081
except (IOError,OSError)ase:
10831082
self.interact.notify(_("Error writing file '%s': %s")%
1084-
(self.config.config.path,str(e)))
1083+
(self.config.config.path,e))
10851084
returnFalse
10861085
else:
10871086
returnFalse

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp