Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mercurial-devel
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
mercurial-devel
Commits
f37f9499fea8
Commit
f37f9499fea8
authored
7 years ago
by
Siddharth Agarwal
Browse files
Options
Downloads
Patches
Plain Diff
demandimport: move ignore list to __init__.py
We're going to use the same ignore list for Python 3.
parent
778dc37ce683
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hgdemandimport/__init__.py
+48
-1
48 additions, 1 deletion
hgdemandimport/__init__.py
hgdemandimport/demandimportpy2.py
+4
-39
4 additions, 39 deletions
hgdemandimport/demandimportpy2.py
with
52 additions
and
40 deletions
hgdemandimport/__init__.py
+
48
−
1
View file @
f37f9499
...
...
@@ -13,5 +13,7 @@
from
__future__
import
absolute_import
import
sys
from
.
import
demandimportpy2
as
demandimport
...
...
@@ -16,3 +18,49 @@
from
.
import
demandimportpy2
as
demandimport
# Extensions can add to this list if necessary.
ignore
=
[
'
__future__
'
,
'
_hashlib
'
,
# ImportError during pkg_resources/__init__.py:fixup_namespace_package
'
_imp
'
,
'
_xmlplus
'
,
'
fcntl
'
,
'
nt
'
,
# pathlib2 tests the existence of built-in 'nt' module
'
win32com.gen_py
'
,
'
win32com.shell
'
,
# 'appdirs' tries to import win32com.shell
'
_winreg
'
,
# 2.7 mimetypes needs immediate ImportError
'
pythoncom
'
,
# imported by tarfile, not available under Windows
'
pwd
'
,
'
grp
'
,
# imported by profile, itself imported by hotshot.stats,
# not available under Windows
'
resource
'
,
# this trips up many extension authors
'
gtk
'
,
# setuptools' pkg_resources.py expects "from __main__ import x" to
# raise ImportError if x not defined
'
__main__
'
,
'
_ssl
'
,
# conditional imports in the stdlib, issue1964
'
_sre
'
,
# issue4920
'
rfc822
'
,
'
mimetools
'
,
'
sqlalchemy.events
'
,
# has import-time side effects (issue5085)
# setuptools 8 expects this module to explode early when not on windows
'
distutils.msvc9compiler
'
,
'
__builtin__
'
,
'
builtins
'
,
'
urwid.command_map
'
,
# for pudb
]
_pypy
=
'
__pypy__
'
in
sys
.
builtin_module_names
if
_pypy
:
ignore
.
extend
([
# _ctypes.pointer is shadowed by "from ... import pointer" (PyPy 5)
'
_ctypes.pointer
'
,
])
demandimport
.
init
(
ignore
)
# Re-export.
...
...
@@ -18,5 +66,4 @@
# Re-export.
ignore
=
demandimport
.
ignore
isenabled
=
demandimport
.
isenabled
enable
=
demandimport
.
enable
disable
=
demandimport
.
disable
...
...
This diff is collapsed.
Click to expand it.
hgdemandimport/demandimportpy2.py
+
4
−
39
View file @
f37f9499
...
...
@@ -265,38 +265,5 @@
return
mod
ignore
=
[
'
__future__
'
,
'
_hashlib
'
,
# ImportError during pkg_resources/__init__.py:fixup_namespace_package
'
_imp
'
,
'
_xmlplus
'
,
'
fcntl
'
,
'
nt
'
,
# pathlib2 tests the existence of built-in 'nt' module
'
win32com.gen_py
'
,
'
win32com.shell
'
,
# 'appdirs' tries to import win32com.shell
'
_winreg
'
,
# 2.7 mimetypes needs immediate ImportError
'
pythoncom
'
,
# imported by tarfile, not available under Windows
'
pwd
'
,
'
grp
'
,
# imported by profile, itself imported by hotshot.stats,
# not available under Windows
'
resource
'
,
# this trips up many extension authors
'
gtk
'
,
# setuptools' pkg_resources.py expects "from __main__ import x" to
# raise ImportError if x not defined
'
__main__
'
,
'
_ssl
'
,
# conditional imports in the stdlib, issue1964
'
_sre
'
,
# issue4920
'
rfc822
'
,
'
mimetools
'
,
'
sqlalchemy.events
'
,
# has import-time side effects (issue5085)
# setuptools 8 expects this module to explode early when not on windows
'
distutils.msvc9compiler
'
,
'
__builtin__
'
,
'
builtins
'
,
'
urwid.command_map
'
,
# for pudb
]
ignore
=
[]
...
...
@@ -302,9 +269,7 @@
if
_pypy
:
ignore
.
extend
([
# _ctypes.pointer is shadowed by "from ... import pointer" (PyPy 5)
'
_ctypes.pointer
'
,
])
def
init
(
ignorelist
):
global
ignore
ignore
=
ignorelist
def
isenabled
():
return
builtins
.
__import__
==
_demandimport
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment