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

Skip to content

Commit e103d68

Browse files
committed
merge
2 parents 14581d5 + 2d7ee47 commit e103d68

120 files changed

Lines changed: 234 additions & 29329 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Lib/test/support.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,10 @@ def _is_ipv6_enabled():
597597

598598
requires_lzma = unittest.skipUnless(lzma, 'requires lzma')
599599

600+
requires_docstrings = unittest.skipUnless(
601+
sysconfig.get_config_var('WITH_DOC_STRINGS'),
602+
"test requires docstrings")
603+
600604
is_jython = sys.platform.startswith('java')
601605

602606
# Filename used for testing

Lib/test/test_bytes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,7 @@ def test_compare_bytes_to_bytearray(self):
11721172
self.assertEqual(bytes(b"abc") < b"ab", False)
11731173
self.assertEqual(bytes(b"abc") <= b"ab", False)
11741174

1175+
@test.support.requires_docstrings
11751176
def test_doc(self):
11761177
self.assertIsNotNone(bytearray.__doc__)
11771178
self.assertTrue(bytearray.__doc__.startswith("bytearray("), bytearray.__doc__)

Lib/test/test_itertools.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,10 +1269,8 @@ def test_tee(self):
12691269

12701270
# Issue 13454: Crash when deleting backward iterator from tee()
12711271
def test_tee_del_backward(self):
1272-
forward, backward = tee(range(20000000))
1273-
for i in forward:
1274-
pass
1275-
1272+
forward, backward = tee(repeat(None, 20000000))
1273+
any(forward) # exhaust the iterator
12761274
del backward
12771275

12781276
def test_StopIteration(self):

Lib/test/test_pydoc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ class PydocDocTest(unittest.TestCase):
256256
"Docstrings are omitted with -O2 and above")
257257
@unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
258258
'trace function introduces __locals__ unexpectedly')
259+
@test.support.requires_docstrings
259260
def test_html_doc(self):
260261
result, doc_loc = get_pydoc_html(pydoc_mod)
261262
mod_file = inspect.getabsfile(pydoc_mod)
@@ -273,6 +274,7 @@ def test_html_doc(self):
273274
"Docstrings are omitted with -O2 and above")
274275
@unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
275276
'trace function introduces __locals__ unexpectedly')
277+
@test.support.requires_docstrings
276278
def test_text_doc(self):
277279
result, doc_loc = get_pydoc_text(pydoc_mod)
278280
expected_text = expected_text_pattern % \
@@ -327,6 +329,7 @@ def test_stripid(self):
327329
'Docstrings are omitted with -O2 and above')
328330
@unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
329331
'trace function introduces __locals__ unexpectedly')
332+
@test.support.requires_docstrings
330333
def test_help_output_redirect(self):
331334
# issue 940286, if output is set in Helper, then all output from
332335
# Helper.help should be redirected
@@ -496,6 +499,7 @@ def test_content_type_err(self):
496499
self.assertRaises(TypeError, f, 'A', '')
497500
self.assertRaises(TypeError, f, 'B', 'foobar')
498501

502+
@test.support.requires_docstrings
499503
def test_url_requests(self):
500504
# Test for the correct title in the html pages returned.
501505
# This tests the different parts of the URL handler without

Makefile.pre.in

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ LIBRARY_OBJS= \
438438

439439
# Default target
440440
all: build_all
441-
build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks Modules/_testembed
441+
build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks Modules/_testembed python-config
442442

443443
# Compile a binary with gcc profile guided optimization.
444444
profile-opt:
@@ -1132,10 +1132,12 @@ $(srcdir)/Lib/$(PLATDIR):
11321132
fi; \
11331133
cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
11341134

1135-
python-config: $(srcdir)/Misc/python-config.in
1135+
python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
11361136
# Substitution happens here, as the completely-expanded BINDIR
11371137
# is not available in configure
1138-
sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
1138+
sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py
1139+
# Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR}
1140+
sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config
11391141

11401142
# Install the include files
11411143
INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
@@ -1193,8 +1195,8 @@ libainstall: all python-config
11931195
$(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
11941196
$(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
11951197
$(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
1198+
$(INSTALL_SCRIPT) python-config.py $(DESTDIR)$(LIBPL)/python-config.py
11961199
$(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(LDVERSION)-config
1197-
rm python-config
11981200
@if [ -s Modules/python.exp -a \
11991201
"`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
12001202
echo; echo "Installing support files for building shared extension modules on AIX:"; \
@@ -1381,6 +1383,7 @@ clobber: clean profile-removal
13811383
config.cache config.log pyconfig.h Modules/config.c
13821384
-rm -rf build platform
13831385
-rm -rf $(PYTHONFRAMEWORKDIR)
1386+
-rm -f python-config.py python-config
13841387

13851388
# Make things extra clean, before making a distribution:
13861389
# remove all generated files, even Makefile[.pre]

Misc/NEWS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ What's New in Python 3.4.0 Alpha 1?
1010
Core and Builtins
1111
-----------------
1212

13+
- Issue #10156: In the interpreter's initialization phase, unicode globals
14+
are now initialized dynamically as needed.
15+
1316
- Issue #16980: Fix processing of escaped non-ascii bytes in the
1417
unicode-escape-decode decoder.
1518

@@ -762,6 +765,10 @@ Tests
762765
Build
763766
-----
764767

768+
- Issue #16235: Implement python-config as a shell script.
769+
770+
- Issue #16769: Remove outdated Visual Studio projects.
771+
765772
- Issue #17031: Fix running regen in cross builds.
766773

767774
- Issue #3754: fix typo in pthread AC_CACHE_VAL.

Misc/python-config.sh.in

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#!/bin/sh
2+
3+
exit_with_usage ()
4+
{
5+
echo "Usage: $0 --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir"
6+
exit $1
7+
}
8+
9+
if [ "$1" = "" ] ; then
10+
exit_with_usage 1
11+
fi
12+
13+
# Returns the actual prefix where this script was installed to.
14+
installed_prefix ()
15+
{
16+
RESULT=$(dirname $(cd $(dirname "$1") && pwd -P))
17+
if which readlink >/dev/null 2>&1 ; then
18+
RESULT=$(readlink -f "$RESULT")
19+
fi
20+
echo $RESULT
21+
}
22+
23+
prefix_build="@prefix@"
24+
prefix_real=$(installed_prefix "$0")
25+
26+
# Use sed to fix paths from their built to locations to their installed to locations.
27+
prefix=$(echo "$prefix_build" | sed "s#$prefix_build#$prefix_real#")
28+
exec_prefix_build="@exec_prefix@"
29+
exec_prefix=$(echo "$exec_prefix_build" | sed "s#$exec_prefix_build#$prefix_real#")
30+
includedir=$(echo "@includedir@" | sed "s#$prefix_build#$prefix_real#")
31+
libdir=$(echo "@libdir@" | sed "s#$prefix_build#$prefix_real#")
32+
CFLAGS=$(echo "@CFLAGS@" | sed "s#$prefix_build#$prefix_real#")
33+
VERSION="@VERSION@"
34+
LIBM="@LIBM@"
35+
LIBC="@LIBC@"
36+
SYSLIBS="$LIBM $LIBC"
37+
ABIFLAGS="@ABIFLAGS@"
38+
LIBS="@LIBS@ $SYSLIBS -lpython${VERSION}${ABIFLAGS}"
39+
BASECFLAGS="@BASECFLAGS@"
40+
LDLIBRARY="@LDLIBRARY@"
41+
LINKFORSHARED="@LINKFORSHARED@"
42+
OPT="@OPT@"
43+
PY_ENABLE_SHARED="@PY_ENABLE_SHARED@"
44+
LDVERSION="@LDVERSION@"
45+
LIBDEST=${prefix}/lib/python${VERSION}
46+
LIBPL=$(echo "@LIBPL@" | sed "s#$prefix_build#$prefix_real#")
47+
SO="@SO@"
48+
PYTHONFRAMEWORK="@PYTHONFRAMEWORK@"
49+
INCDIR="-I$includedir/python${VERSION}${ABIFLAGS}"
50+
PLATINCDIR="-I$includedir/python${VERSION}${ABIFLAGS}"
51+
52+
# Scan for --help or unknown argument.
53+
for ARG in $*
54+
do
55+
case $ARG in
56+
--help)
57+
exit_with_usage 0
58+
;;
59+
--prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--abiflags|--configdir)
60+
;;
61+
*)
62+
exit_with_usage 1
63+
;;
64+
esac
65+
done
66+
67+
for ARG in "$@"
68+
do
69+
case "$ARG" in
70+
--prefix)
71+
echo "$prefix"
72+
;;
73+
--exec-prefix)
74+
echo "$exec_prefix"
75+
;;
76+
--includes)
77+
echo "$INCDIR $PLATINCDIR"
78+
;;
79+
--cflags)
80+
echo "$INCDIR $PLATINCDIR $BASECFLAGS $CFLAGS $OPT"
81+
;;
82+
--libs)
83+
echo "$LIBS"
84+
;;
85+
--ldflags)
86+
LINKFORSHAREDUSED=
87+
if [ -z "$PYTHONFRAMEWORK" ] ; then
88+
LINKFORSHAREDUSED=$LINKFORSHARED
89+
fi
90+
LIBPLUSED=
91+
if [ "$PY_ENABLE_SHARED" = "0" ] ; then
92+
LIBPLUSED="-L$LIBPL"
93+
fi
94+
echo "$LIBPLUSED -L$libdir $LIBS $LINKFORSHAREDUSED"
95+
;;
96+
--extension-suffix)
97+
echo "$SO"
98+
;;
99+
--abiflags)
100+
echo "$ABIFLAGS"
101+
;;
102+
--configdir)
103+
echo "$LIBPL"
104+
;;
105+
esac
106+
done

0 commit comments

Comments
 (0)