Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f52d27e

Browse files
committed
Fix bug #232619: fix misleading warning on installing to lib-dynload
1 parent c02bc3e commit f52d27e

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

setup.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from distutils.errors import *
1313
from distutils.core import Extension, setup
1414
from distutils.command.build_ext import build_ext
15+
from distutils.command.install import install
1516

1617
# This global variable is used to hold the list of modules to be disabled.
1718
disabled_module_list = []
@@ -598,10 +599,18 @@ def detect_tkinter(self, inc_dirs, lib_dirs):
598599
# *** Uncomment these for TOGL extension only:
599600
# -lGL -lGLU -lXext -lXmu \
600601

602+
class PyBuildInstall(install):
603+
# Suppress the warning about installation into the lib_dynload
604+
# directory, which is not in sys.path when running Python during
605+
# installation:
606+
def initialize_options (self):
607+
install.initialize_options(self)
608+
self.warn_dir=0
609+
601610
def main():
602611
setup(name = 'Python standard library',
603612
version = '%d.%d' % sys.version_info[:2],
604-
cmdclass = {'build_ext':PyBuildExt},
613+
cmdclass = {'build_ext':PyBuildExt, 'install':PyBuildInstall},
605614
# The struct module is defined here, because build_ext won't be
606615
# called unless there's at least one extension module defined.
607616
ext_modules=[Extension('struct', ['structmodule.c'])],

0 commit comments

Comments
 (0)