Mercurial > public > mercurial-scm > hg
comparison mercurial/ui.py @ 49306:2e726c934fcd
py3: catch FileNotFoundError instead of checking errno == ENOENT
author | Manuel Jacob <me@manueljacob.de> |
---|---|
date | Tue, 31 May 2022 22:50:01 +0200 |
parents | 7afa96d3b484 |
children | 8147abc05794 |
comparison
equal
deleted
inserted
replaced
49305:53e9422a9b45 | 49306:2e726c934fcd |
---|---|
1515 stdin=subprocess.PIPE, | 1515 stdin=subprocess.PIPE, |
1516 stdout=procutil.stdout, | 1516 stdout=procutil.stdout, |
1517 stderr=procutil.stderr, | 1517 stderr=procutil.stderr, |
1518 env=procutil.tonativeenv(procutil.shellenviron(env)), | 1518 env=procutil.tonativeenv(procutil.shellenviron(env)), |
1519 ) | 1519 ) |
1520 except OSError as e: | 1520 except FileNotFoundError: |
1521 if e.errno == errno.ENOENT and not shell: | 1521 if not shell: |
1522 self.warn( | 1522 self.warn( |
1523 _(b"missing pager command '%s', skipping pager\n") % command | 1523 _(b"missing pager command '%s', skipping pager\n") % command |
1524 ) | 1524 ) |
1525 return False | 1525 return False |
1526 raise | 1526 raise |