Show More
@@ -77,7 +77,22 b' class request(object):' | |||||
77 |
|
77 | |||
78 | def run(): |
|
78 | def run(): | |
79 | "run the command in sys.argv" |
|
79 | "run the command in sys.argv" | |
80 |
|
|
80 | req = request(pycompat.sysargv[1:]) | |
|
81 | err = None | |||
|
82 | try: | |||
|
83 | status = (dispatch(req) or 0) & 255 | |||
|
84 | except error.StdioError as err: | |||
|
85 | status = -1 | |||
|
86 | if util.safehasattr(req.ui, 'fout'): | |||
|
87 | try: | |||
|
88 | req.ui.fout.close() | |||
|
89 | except IOError as err: | |||
|
90 | status = -1 | |||
|
91 | if util.safehasattr(req.ui, 'ferr'): | |||
|
92 | if err is not None and err.errno != errno.EPIPE: | |||
|
93 | req.ui.ferr.write('abort: %s\n' % err.strerror) | |||
|
94 | req.ui.ferr.close() | |||
|
95 | sys.exit(status & 255) | |||
81 |
|
96 | |||
82 | def _getsimilar(symbols, value): |
|
97 | def _getsimilar(symbols, value): | |
83 | sim = lambda x: difflib.SequenceMatcher(None, value, x).ratio() |
|
98 | sim = lambda x: difflib.SequenceMatcher(None, value, x).ratio() |
General Comments 0
You need to be logged in to leave comments.
Login now