Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f126e603
Commit
f126e603
authored
Jun 16, 2010
by
Stefan Krah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #7384: If the system readline library is linked against
ncurses, do not link the readline module against ncursesw.
parent
1e3e804f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
24 deletions
+53
-24
Lib/test/test_curses.py
Lib/test/test_curses.py
+0
-5
Misc/NEWS
Misc/NEWS
+5
-0
setup.py
setup.py
+48
-19
No files found.
Lib/test/test_curses.py
View file @
f126e603
...
@@ -23,11 +23,6 @@ requires('curses')
...
@@ -23,11 +23,6 @@ requires('curses')
curses
=
import_module
(
'curses'
)
curses
=
import_module
(
'curses'
)
curses
.
panel
=
import_module
(
'curses.panel'
)
curses
.
panel
=
import_module
(
'curses.panel'
)
# skip all these tests on FreeBSD: test_curses currently hangs the
# FreeBSD buildbots, preventing other tests from running. See issue
# #7384.
if
'freebsd'
in
sys
.
platform
:
raise
unittest
.
SkipTest
(
'The curses module is broken on FreeBSD. See http://bugs.python.org/issue7384.'
)
# XXX: if newterm was supported we could use it instead of initscr and not exit
# XXX: if newterm was supported we could use it instead of initscr and not exit
term
=
os
.
environ
.
get
(
'TERM'
)
term
=
os
.
environ
.
get
(
'TERM'
)
...
...
Misc/NEWS
View file @
f126e603
...
@@ -244,6 +244,11 @@ Library
...
@@ -244,6 +244,11 @@ Library
Extension Modules
Extension Modules
-----------------
-----------------
- Issue #7384: If the system readline library is linked against
ncurses, do not link the readline module against ncursesw. The
additional restriction of linking the readline and curses modules
against the same curses library is currently not enabled.
- Issue #8973: Add __all__ to struct module; this ensures that
- Issue #8973: Add __all__ to struct module; this ensures that
help(struct) includes documentation for the struct.Struct class.
help(struct) includes documentation for the struct.Struct class.
...
...
setup.py
View file @
f126e603
...
@@ -14,6 +14,7 @@ from distutils.core import Extension, setup
...
@@ -14,6 +14,7 @@ from distutils.core import Extension, setup
from
distutils.command.build_ext
import
build_ext
from
distutils.command.build_ext
import
build_ext
from
distutils.command.install
import
install
from
distutils.command.install
import
install
from
distutils.command.install_lib
import
install_lib
from
distutils.command.install_lib
import
install_lib
from
distutils.spawn
import
find_executable
# This global variable is used to hold the list of modules to be disabled.
# This global variable is used to hold the list of modules to be disabled.
disabled_module_list
=
[]
disabled_module_list
=
[]
...
@@ -538,6 +539,42 @@ class PyBuildExt(build_ext):
...
@@ -538,6 +539,42 @@ class PyBuildExt(build_ext):
# readline
# readline
do_readline
=
self
.
compiler
.
find_library_file
(
lib_dirs
,
'readline'
)
do_readline
=
self
.
compiler
.
find_library_file
(
lib_dirs
,
'readline'
)
readline_termcap_library
=
""
curses_library
=
""
# Determine if readline is already linked against curses or tinfo.
if
do_readline
and
find_executable
(
'ldd'
):
# Cannot use os.popen here in py3k.
tmpfile
=
os
.
path
.
join
(
self
.
build_temp
,
'readline_termcap_lib'
)
if
not
os
.
path
.
exists
(
self
.
build_temp
):
os
.
makedirs
(
self
.
build_temp
)
os
.
system
(
"ldd %s > %s"
%
(
do_readline
,
tmpfile
))
fp
=
open
(
tmpfile
)
for
ln
in
fp
:
if
'curses'
in
ln
:
readline_termcap_library
=
re
.
sub
(
r'.*lib(n?cursesw?)\
.so.*
', r'
\
1
', ln
).rstrip()
break
if '
tinfo
' in ln: # termcap interface split out from ncurses
readline_termcap_library = '
tinfo
'
break
fp.close()
os.unlink(tmpfile)
# Issue 7384: If readline is already linked against curses,
# use the same library for the readline and curses modules.
# Disabled since applications relying on ncursesw might break.
#
# if '
curses
' in readline_termcap_library:
# curses_library = readline_termcap_library
# elif self.compiler.find_library_file(lib_dirs, '
ncursesw
'):
# (...)
if self.compiler.find_library_file(lib_dirs, '
ncursesw
'):
curses_library = '
ncursesw
'
elif self.compiler.find_library_file(lib_dirs, '
ncurses
'):
curses_library = '
ncurses
'
elif self.compiler.find_library_file(lib_dirs, '
curses
'):
curses_library = '
curses
'
if platform == '
darwin
': # and os.uname()[2] < '
9.
':
if platform == '
darwin
': # and os.uname()[2] < '
9.
':
# MacOSX 10.4 has a broken readline. Don'
t
try
to
build
# MacOSX 10.4 has a broken readline. Don'
t
try
to
build
# the readline module unless the user has installed a fixed
# the readline module unless the user has installed a fixed
...
@@ -558,14 +595,10 @@ class PyBuildExt(build_ext):
...
@@ -558,14 +595,10 @@ class PyBuildExt(build_ext):
readline_extra_link_args
=
()
readline_extra_link_args
=
()
readline_libs
=
[
'readline'
]
readline_libs
=
[
'readline'
]
if
self
.
compiler
.
find_library_file
(
lib_dirs
,
if
readline_termcap_library
:
'ncursesw'
):
pass
# Issue 7384: Already linked against curses or tinfo.
readline_libs
.
append
(
'ncursesw'
)
elif
curses_library
:
elif
self
.
compiler
.
find_library_file
(
lib_dirs
,
readline_libs
.
append
(
curses_library
)
'ncurses'
):
readline_libs
.
append
(
'ncurses'
)
elif
self
.
compiler
.
find_library_file
(
lib_dirs
,
'curses'
):
readline_libs
.
append
(
'curses'
)
elif
self
.
compiler
.
find_library_file
(
lib_dirs
+
elif
self
.
compiler
.
find_library_file
(
lib_dirs
+
[
'/usr/lib/termcap'
],
[
'/usr/lib/termcap'
],
'termcap'
):
'termcap'
):
...
@@ -1071,19 +1104,15 @@ class PyBuildExt(build_ext):
...
@@ -1071,19 +1104,15 @@ class PyBuildExt(build_ext):
# Curses support, requiring the System V version of curses, often
# Curses support, requiring the System V version of curses, often
# provided by the ncurses library.
# provided by the ncurses library.
panel_library
=
'panel'
panel_library
=
'panel'
if
(
self
.
compiler
.
find_library_file
(
lib_dirs
,
'ncursesw'
)):
if
curses_library
.
startswith
(
'ncurses'
):
curses_libs
=
[
'ncursesw'
]
if
curses_library
==
'ncursesw'
:
# Bug 1464056: If _curses.so links with ncursesw,
# Bug 1464056: If _curses.so links with ncursesw,
# _curses_panel.so must link with panelw.
# _curses_panel.so must link with panelw.
panel_library
=
'panelw'
panel_library
=
'panelw'
exts
.
append
(
Extension
(
'_curses'
,
[
'_cursesmodule.c'
],
curses_libs
=
[
curses_library
]
libraries
=
curses_libs
)
)
elif
(
self
.
compiler
.
find_library_file
(
lib_dirs
,
'ncurses'
)):
curses_libs
=
[
'ncurses'
]
exts
.
append
(
Extension
(
'_curses'
,
[
'_cursesmodule.c'
],
exts
.
append
(
Extension
(
'_curses'
,
[
'_cursesmodule.c'
],
libraries
=
curses_libs
)
)
libraries
=
curses_libs
)
)
elif
(
self
.
compiler
.
find_library_file
(
lib_dirs
,
'curses'
)
elif
curses_library
==
'curses'
and
platform
!=
'darwin'
:
and
platform
!=
'darwin'
):
# OSX has an old Berkeley curses, not good enough for
# OSX has an old Berkeley curses, not good enough for
# the _curses module.
# the _curses module.
if
(
self
.
compiler
.
find_library_file
(
lib_dirs
,
'terminfo'
)):
if
(
self
.
compiler
.
find_library_file
(
lib_dirs
,
'terminfo'
)):
...
...
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