[PATCH 2 of 3] demandimport: add 'nt' to ignore list (issue5373)

Yuya Nishihara yuya at tcha.org
Tue Sep 27 10:12:15 EDT 2016


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1474980960 -32400
#      Tue Sep 27 21:56:00 2016 +0900
# Node ID 4a8f4b4339238e71ef27a737bb9af2d8b4adb665
# Parent  082f29026f21f6bae4615adbeb6a963eaf7029ea
demandimport: add 'nt' to ignore list (issue5373)

pathlib2 tries to import nt. Since it is a built-in module, there should be
no performance penalty.

https://github.com/mcmtroffaes/pathlib2/blob/release/2.2.0/pathlib2.py#L33

diff --git a/mercurial/demandimport.py b/mercurial/demandimport.py
--- a/mercurial/demandimport.py
+++ b/mercurial/demandimport.py
@@ -264,6 +264,7 @@ ignore = [
     '_imp',
     '_xmlplus',
     'fcntl',
+    'nt', # pathlib2 tests the existence of built-in 'nt' module
     'win32com.gen_py',
     '_winreg', # 2.7 mimetypes needs immediate ImportError
     'pythoncom',


More information about the Mercurial-devel mailing list