Skip to content

Commit 6ef79c3

Browse files
committed
Use errno.ENOENT rather than hardcoding the error code.
1 parent 63b07a2 commit 6ef79c3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bpython/repl.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from __future__ import with_statement
2525
import code
2626
import codecs
27+
import errno
2728
import inspect
2829
import os
2930
import pydoc
@@ -822,7 +823,7 @@ def do_pastebin_helper(self, s):
822823
helper.stdin.write(s.encode())
823824
paste_url = helper.communicate()[0].decode().strip()
824825
except OSError, e:
825-
if e.errno == 2:
826+
if e.errno == errno.ENOENT:
826827
self.interact.notify('Upload failed: Helper program not found.')
827828
else:
828829
self.interact.notify('Upload failed: Helper program could not be run.')

0 commit comments

Comments
 (0)