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

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 27, 2016, 2:12 p.m.
Message ID <4a8f4b4339238e71ef27.1474985535@mimosa>
Download mbox | patch
Permalink /patch/16792/
State Accepted
Headers show

Comments

Yuya Nishihara - Sept. 27, 2016, 2:12 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@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

Patch

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',