mirror of
https://github.com/python/cpython
synced 2024-10-14 16:37:41 +00:00
bpo-45561: Run smelly.py tool from $(srcdir) (GH-29138)
This commit is contained in:
parent
024209401e
commit
457e6a6e96
|
@ -2420,7 +2420,7 @@ distclean: clobber
|
||||||
|
|
||||||
# Check that all symbols exported by libpython start with "Py" or "_Py"
|
# Check that all symbols exported by libpython start with "Py" or "_Py"
|
||||||
smelly: @DEF_MAKE_RULE@
|
smelly: @DEF_MAKE_RULE@
|
||||||
$(RUNSHARED) ./$(BUILDPYTHON) Tools/scripts/smelly.py
|
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/smelly.py
|
||||||
|
|
||||||
# Find files with funny names
|
# Find files with funny names
|
||||||
funny:
|
funny:
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Run smelly.py tool from $(srcdir).
|
|
@ -108,8 +108,11 @@ def check_library(library, dynamic=False):
|
||||||
|
|
||||||
def check_extensions():
|
def check_extensions():
|
||||||
print(__file__)
|
print(__file__)
|
||||||
srcdir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
|
# This assumes pybuilddir.txt is in same directory as pyconfig.h.
|
||||||
filename = os.path.join(srcdir, "pybuilddir.txt")
|
# In the case of out-of-tree builds, we can't assume pybuilddir.txt is
|
||||||
|
# in the source folder.
|
||||||
|
config_dir = os.path.dirname(sysconfig.get_config_h_filename())
|
||||||
|
filename = os.path.join(config_dir, "pybuilddir.txt")
|
||||||
try:
|
try:
|
||||||
with open(filename, encoding="utf-8") as fp:
|
with open(filename, encoding="utf-8") as fp:
|
||||||
pybuilddir = fp.readline()
|
pybuilddir = fp.readline()
|
||||||
|
@ -118,7 +121,7 @@ def check_extensions():
|
||||||
return True
|
return True
|
||||||
|
|
||||||
print(f"Check extension modules from {pybuilddir} directory")
|
print(f"Check extension modules from {pybuilddir} directory")
|
||||||
builddir = os.path.join(srcdir, pybuilddir)
|
builddir = os.path.join(config_dir, pybuilddir)
|
||||||
nsymbol = 0
|
nsymbol = 0
|
||||||
for name in os.listdir(builddir):
|
for name in os.listdir(builddir):
|
||||||
if not name.endswith(".so"):
|
if not name.endswith(".so"):
|
||||||
|
|
Loading…
Reference in a new issue