diff mercurial/cmdutil.py @ 52402:00f5966f0483

cmdutil: stop using the `pycompat.open()` shim Somewhat dubious I suppose, but maybe it makes sense to use the type checking system to more aggressively use str for trivial things like the `mode` argument to the function that calls this. That's a project for another day.
author Matt Harbison <matt_harbison@yahoo.com>
date Wed, 04 Dec 2024 21:09:12 -0500
parents f4733654f144
children 9d79ffeed7c0
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Wed Dec 04 21:05:33 2024 -0500
+++ b/mercurial/cmdutil.py	Wed Dec 04 21:09:12 2024 -0500
@@ -30,9 +30,6 @@
     nullrev,
     short,
 )
-from .pycompat import (
-    open,
-)
 from .thirdparty import attr
 
 # Force pytype to use the non-vendored package
@@ -1406,7 +1403,7 @@
             fp = repo.ui.fin
         return _unclosablefile(fp)
     fn = makefilename(ctx, pat, **props)
-    return open(fn, mode)
+    return open(fn, pycompat.sysstr(mode))
 
 
 def openstorage(repo, cmd, file_, opts, returnrevlog=False):