diff 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
line wrap: on
line diff
--- a/mercurial/ui.py	Tue May 31 21:16:17 2022 +0200
+++ b/mercurial/ui.py	Tue May 31 22:50:01 2022 +0200
@@ -1517,8 +1517,8 @@
                 stderr=procutil.stderr,
                 env=procutil.tonativeenv(procutil.shellenviron(env)),
             )
-        except OSError as e:
-            if e.errno == errno.ENOENT and not shell:
+        except FileNotFoundError:
+            if not shell:
                 self.warn(
                     _(b"missing pager command '%s', skipping pager\n") % command
                 )