@@ -717,8 +717,7 @@ def write2file(self):
717
717
with open (fn , mode ) as f :
718
718
f .write (s )
719
719
except IOError as e :
720
- self .interact .notify (_ ("Error writing file '%s': %s" ) % (fn ,
721
- str (e )))
720
+ self .interact .notify (_ ("Error writing file '%s': %s" ) % (fn , e ))
722
721
else :
723
722
self .interact .notify (_ ('Saved to %s.' ) % (fn , ))
724
723
@@ -778,7 +777,7 @@ def do_pastebin_json(self, s):
778
777
response = requests .post (url , data = payload , verify = True )
779
778
response .raise_for_status ()
780
779
except requests .exceptions .RequestException as exc :
781
- self .interact .notify (_ ('Upload failed: %s' ) % (str ( exc ) , ))
780
+ self .interact .notify (_ ('Upload failed: %s' ) % (exc , ))
782
781
return
783
782
784
783
self .prev_pastebin_content = s
@@ -866,7 +865,7 @@ def insert_into_history(self, s):
866
865
self .rl_history .append_reload_and_write (s , self .config .hist_file ,
867
866
getpreferredencoding ())
868
867
except RuntimeError as e :
869
- self .interact .notify (str ( e ))
868
+ self .interact .notify (u"%s" % ( e , ))
870
869
871
870
def prompt_undo (self ):
872
871
"""Returns how many lines to undo, 0 means don't undo"""
@@ -1081,7 +1080,7 @@ def edit_config(self):
1081
1080
f .write (default_config )
1082
1081
except (IOError , OSError ) as e :
1083
1082
self .interact .notify (_ ("Error writing file '%s': %s" ) %
1084
- (self .config .config .path , str ( e ) ))
1083
+ (self .config .config .path , e ))
1085
1084
return False
1086
1085
else :
1087
1086
return False
0 commit comments