Skip to content

Commit d804cc9

Browse files
committed
Move setting the previous pastebin content to after the upload in do_pastebin_xmlrpc().
This is in line with how I did it in do_pastebin_helper(), and makes overall more sense. With the old flow, you could get a dupe error just when retrying after the last upload failed due to e.g. a network error.
1 parent f514e8f commit d804cc9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bpython/repl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,8 +797,6 @@ def do_pastebin_xmlrpc(self, s):
797797
(self.config.pastebin_url, str(e)))
798798
return
799799

800-
self.prev_pastebin_content = s
801-
802800
self.interact.notify('Posting data to pastebin...')
803801
try:
804802
paste_id = pasteservice.pastes.newPaste('pycon', s, '', '', '',
@@ -807,6 +805,8 @@ def do_pastebin_xmlrpc(self, s):
807805
self.interact.notify('Upload failed: %s' % (str(e), ) )
808806
return
809807

808+
self.prev_pastebin_content = s
809+
810810
paste_url_template = Template(self.config.pastebin_show_url)
811811
paste_id = urlquote(paste_id)
812812
paste_url = paste_url_template.safe_substitute(paste_id=paste_id)

0 commit comments

Comments
 (0)