Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
f5b89afa
Commit
f5b89afa
authored
Nov 15, 2016
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rework import warnings.
parent
14b2c1da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
Cython/Distutils/old_build_ext.py
Cython/Distutils/old_build_ext.py
+18
-12
No files found.
Cython/Distutils/old_build_ext.py
View file @
f5b89afa
...
...
@@ -17,24 +17,30 @@ from distutils.command import build_ext as _build_ext
from
distutils
import
sysconfig
import
warnings
try
:
frames
=
inspect
.
getouterframes
(
inspect
.
currentframe
(),
2
)
from_setuptools
=
'setuptools/extension.py'
in
frames
[
2
][
1
]
from_pyximport
=
'pyximport/pyxbuild.py'
in
frames
[
1
][
1
]
from_cy_buildext
=
'Cython/Distutils/build_ext.py'
in
frames
[
1
][
1
]
except
Exception
:
from_setuptools
=
from_pyximport
=
from_cy_buildext
=
False
if
not
from_setuptools
and
not
from_pyximport
and
not
from_cy_buildext
:
warnings
.
warn
(
"Cython.Distutils.old_build_ext does not properly handle dependencies "
"and is deprecated."
)
try
:
from
__builtin__
import
basestring
except
ImportError
:
basestring
=
str
def
_check_stack
(
path
):
try
:
for
frame
in
inspect
.
getouterframes
(
inspect
.
currentframe
(),
0
):
if
path
in
frame
[
1
].
replace
(
os
.
sep
,
'/'
):
return
True
except
Exception
:
pass
return
False
if
(
not
_check_stack
(
'setuptools/extensions.py'
)
and
not
_check_stack
(
'pyximport/pyxbuild.py'
)
and
not
_check_stack
(
'Cython/Distutils/build_ext.py'
)):
warnings
.
warn
(
"Cython.Distutils.old_build_ext does not properly handle dependencies "
"and is deprecated."
)
extension_name_re
=
_build_ext
.
extension_name_re
show_compilers
=
_build_ext
.
show_compilers
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment