[PATCH] hgdemandimport: avoid Python 3.15 errors for heapq and copy

Mads Kiilerich mads at kiilerich.com
Sat Mar 28 16:13:33 UTC 2026


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1774706053 -3600
#      Sat Mar 28 14:54:13 2026 +0100
# Branch stable
# Node ID 4ef356e1dd1f573af87bc4ab5aa3d1a0be925346
# Parent  1afb8f260d18a38a94e81398a778f9430f103ba8
hgdemandimport: avoid Python 3.15 errors for heapq and copy

Got:

    ImportError: cannot import name 'nlargest' from 'heapq'

The new PEP 810 lazy imports might enable new ways of doing things. In the
future.

diff --git a/hgdemandimport/__init__.py b/hgdemandimport/__init__.py
--- a/hgdemandimport/__init__.py
+++ b/hgdemandimport/__init__.py
@@ -65,6 +65,8 @@ IGNORES = {
     'warnings',
     'threading',
     'collections.abc',
+    'heapq',
+    'copy',
 }
 
 _pypy = '__pypy__' in sys.builtin_module_names



More information about the Mercurial-devel mailing list