Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit c436039

Browse files
author
Anselm Kruis
committed
Merge branch master into master-slp
2 parents 3131f57 + 5028938 commit c436039

30 files changed

+176
-119
lines changed

Doc/conf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@
7676

7777
# Custom sidebar templates, filenames relative to this file.
7878
html_sidebars = {
79-
'index': 'indexsidebar.html',
79+
# Defaults taken from http://www.sphinx-doc.org/en/stable/config.html#confval-html_sidebars
80+
# Removes the quick search block
81+
'**': ['localtoc.html', 'relations.html', 'customsourcelink.html'],
82+
'index': ['indexsidebar.html'],
8083
}
8184

8285
# Additional templates that should be rendered to pages.

Doc/tools/pydoctheme/static/pydoctheme.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ div.related:first-child {
2222
border-bottom: 1px solid #ccc;
2323
}
2424

25+
.inline-search {
26+
display: inline;
27+
}
28+
form.inline-search input {
29+
display: inline;
30+
}
31+
form.inline-search input[type="submit"] {
32+
width: 30px;
33+
}
34+
2535
div.sphinxsidebar {
2636
background-color: #eeeeee;
2737
border-radius: 5px;
@@ -45,6 +55,7 @@ div.sphinxsidebar a:hover {
4555
color: #0095C4;
4656
}
4757

58+
form.inline-search input,
4859
div.sphinxsidebar input {
4960
font-family: 'Lucida Grande',Arial,sans-serif;
5061
border: 1px solid #999999;

Doc/tools/susp-ignored.csv

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,6 @@ whatsnew/3.2,,:feed,>>> urllib.parse.urlparse('http://[dead:beef:cafe:5417:affe:
276276
whatsnew/3.2,,:gz,">>> with tarfile.open(name='myarchive.tar.gz', mode='w:gz') as tf:"
277277
whatsnew/3.2,,:location,zope9-location = ${zope9:location}
278278
whatsnew/3.2,,:prefix,zope-conf = ${custom:prefix}/etc/zope.conf
279-
whatsnew/changelog,,:version,import sys; I = version[:version.index(' ')]
280-
whatsnew/changelog,,:gz,": TarFile opened with external fileobj and ""w:gz"" mode didn't"
281-
whatsnew/changelog,,::,": Use ""127.0.0.1"" or ""::1"" instead of ""localhost"" as much as"
282279
library/tarfile,149,:xz,'x:xz'
283280
library/xml.etree.elementtree,290,:sometag,prefix:sometag
284281
library/xml.etree.elementtree,301,:fictional,"<actors xmlns:fictional=""http://characters.example.com"""
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{%- if show_source and has_source and sourcename %}
2+
<div role="note" aria-label="source link">
3+
<h3>{{ _('This Page') }}</h3>
4+
<ul class="this-page-menu">
5+
<li><a href="{{ pathto('bugs') }}">{% trans %}Report a Bug{% endtrans %}</a></li>
6+
<li><a href="{{ pathto('_sources/' + sourcename, true)|e }}"
7+
rel="nofollow">{{ _('Show Source') }}</a></li>
8+
</ul>
9+
</div>
10+
{%- endif %}

Doc/tools/templates/layout.html

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,28 @@
1212
{%- endif %}
1313
</li>
1414
{% endblock %}
15+
{%- macro searchbox() %}
16+
{# modified from sphinx/themes/basic/searchbox.html #}
17+
<div class="inline-search" style="display: none" role="search">
18+
<form class="inline-search" action="{{ pathto('search') }}" method="get">
19+
<input placeholder="{{ _('Quick search') }}" type="text" name="q" />
20+
<input type="submit" value="{{ _('Go') }}" />
21+
<input type="hidden" name="check_keywords" value="yes" />
22+
<input type="hidden" name="area" value="default" />
23+
</form>
24+
</div>
25+
<script type="text/javascript">$('.inline-search').show(0);</script>
26+
{%- endmacro %}
1527
{% block relbar1 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %}
1628
{% block relbar2 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %}
29+
{% block relbaritems %}
30+
{%- if pagename != "search" and builder != "singlehtml" %}
31+
<li class="right">
32+
{{ searchbox() }}
33+
{{ reldelim2 }}
34+
</li>
35+
{%- endif %}
36+
{% endblock %}
1737
{% block extrahead %}
1838
<link rel="shortcut icon" type="image/png" href="{{ pathto('_static/py.png', 1) }}" />
1939
{% if not embedded %}<script type="text/javascript" src="{{ pathto('_static/copybutton.js', 1) }}"></script>{% endif %}
@@ -90,13 +110,3 @@
90110
{% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
91111
</div>
92112
{% endblock %}
93-
{% block sidebarsourcelink %}
94-
{%- if show_source and has_source and sourcename %}
95-
<h3>{{ _('This Page') }}</h3>
96-
<ul class="this-page-menu">
97-
<li><a href="{{ pathto('bugs') }}">{% trans %}Report a Bug{% endtrans %}</a></li>
98-
<li><a href="{{ pathto('_sources/' + sourcename, true)|e }}"
99-
rel="nofollow">{% trans %}Show Source{% endtrans %}</a></li>
100-
</ul>
101-
{%- endif %}
102-
{% endblock %}

Doc/whatsnew/3.6.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,9 @@ Deprecated Python modules, functions and methods
981981
been deprecated in previous versions of Python in favour of
982982
:meth:`importlib.abc.Loader.exec_module`.
983983

984+
* The :mod:`tkinter.tix` module is now deprecated. :mod:`tkinter` users should
985+
use :mod:`tkinter.ttk` instead.
986+
984987

985988
Deprecated functions and types of the C API
986989
-------------------------------------------

Lib/asyncio/futures.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,15 @@ class Future:
134134
_loop = None
135135
_source_traceback = None
136136

137-
_blocking = False # proper use of future (yield vs yield from)
137+
# This field is used for a dual purpose:
138+
# - Its presence is a marker to declare that a class implements
139+
# the Future protocol (i.e. is intended to be duck-type compatible).
140+
# The value must also be not-None, to enable a subclass to declare
141+
# that it is not compatible by setting this to None.
142+
# - It is set by __iter__() below so that Task._step() can tell
143+
# the difference between `yield from Future()` (correct) vs.
144+
# `yield Future()` (incorrect).
145+
_asyncio_future_blocking = False
138146

139147
_log_traceback = False # Used for Python 3.4 and later
140148
_tb_logger = None # Used for Python 3.3 only
@@ -357,7 +365,7 @@ def set_exception(self, exception):
357365

358366
def __iter__(self):
359367
if not self.done():
360-
self._blocking = True
368+
self._asyncio_future_blocking = True
361369
yield self # This tells Task to wait for completion.
362370
assert self.done(), "yield from wasn't used with future"
363371
return self.result() # May raise too.

Lib/asyncio/tasks.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,16 +249,17 @@ def _step(self, exc=None):
249249
self.set_exception(exc)
250250
raise
251251
else:
252-
if isinstance(result, futures.Future):
252+
blocking = getattr(result, '_asyncio_future_blocking', None)
253+
if blocking is not None:
253254
# Yielded Future must come from Future.__iter__().
254255
if result._loop is not self._loop:
255256
self._loop.call_soon(
256257
self._step,
257258
RuntimeError(
258259
'Task {!r} got Future {!r} attached to a '
259260
'different loop'.format(self, result)))
260-
elif result._blocking:
261-
result._blocking = False
261+
elif blocking:
262+
result._asyncio_future_blocking = False
262263
result.add_done_callback(self._wakeup)
263264
self._fut_waiter = result
264265
if self._must_cancel:

Lib/importlib/_bootstrap_external.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,8 +1440,3 @@ def _install(_bootstrap_module):
14401440
if _os.__name__ == 'nt':
14411441
sys.meta_path.append(WindowsRegistryFinder)
14421442
sys.meta_path.append(PathFinder)
1443-
1444-
# XXX We expose a couple of classes in _bootstrap for the sake of
1445-
# a setuptools bug (https://bitbucket.org/pypa/setuptools/issue/378).
1446-
_bootstrap_module.FileFinder = FileFinder
1447-
_bootstrap_module.SourceFileLoader = SourceFileLoader
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Lib/test/test_tokenize.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
STRING, ENDMARKER, ENCODING, tok_name, detect_encoding,
44
open as tokenize_open, Untokenizer)
55
from io import BytesIO
6-
from unittest import TestCase, mock
6+
from unittest import TestCase, mock, main
77
import os
88
import token
99

@@ -1529,12 +1529,13 @@ def test_random_files(self):
15291529
tempdir = os.path.dirname(fn) or os.curdir
15301530
testfiles = glob.glob(os.path.join(tempdir, "test*.py"))
15311531

1532-
# Tokenize is broken on test_pep3131.py because regular expressions are
1533-
# broken on the obscure unicode identifiers in it. *sigh*
1534-
# With roundtrip extended to test the 5-tuple mode of untokenize,
1535-
# 7 more testfiles fail. Remove them also until the failure is diagnosed.
1532+
# Tokenize is broken on test_unicode_identifiers.py because regular
1533+
# expressions are broken on the obscure unicode identifiers in it.
1534+
# *sigh* With roundtrip extended to test the 5-tuple mode of
1535+
# untokenize, 7 more testfiles fail. Remove them also until the
1536+
# failure is diagnosed.
15361537

1537-
testfiles.remove(os.path.join(tempdir, "test_pep3131.py"))
1538+
testfiles.remove(os.path.join(tempdir, "test_unicode_identifiers.py"))
15381539
for f in ('buffer', 'builtin', 'fileio', 'inspect', 'os', 'platform', 'sys'):
15391540
testfiles.remove(os.path.join(tempdir, "test_%s.py") % f)
15401541

@@ -1564,4 +1565,4 @@ def test_indentation_semantics_retained(self):
15641565

15651566

15661567
if __name__ == "__main__":
1567-
unittest.main()
1568+
main()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Alicia Arlen
5959
Jeffrey Armstrong
6060
Jason Asbahr
6161
David Ascher
62+
Ammar Askar
6263
Chris AtLee
6364
Aymeric Augustin
6465
John Aycock

Misc/NEWS

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

13+
- Issue #27213: Rework CALL_FUNCTION* opcodes to produce shorter and more
14+
efficient bytecode. Patch by Demur Rumed, design by Serhiy Storchaka,
15+
reviewed by Serhiy Storchaka and Victor Stinner.
16+
1317
- Issue #27999: Make "global after use" a SyntaxError, and ditto for nonlocal.
1418
Patch by Ivan Levkivskyi.
1519

@@ -769,6 +773,9 @@ Tools/Demos
769773
Documentation
770774
-------------
771775

776+
- Issue #19489: Moved the search box from the sidebar to the header and footer
777+
of each page. Patch by Ammar Askar.
778+
772779
- Issue #27285: Update documentation to reflect the deprecation of ``pyvenv``
773780
and normalize on the term "virtual environment". Patch by Steve Piercy.
774781

Objects/bytes_methods.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ _Py_bytes_contains(const char *str, Py_ssize_t len, PyObject *arg)
670670
* against substr, using the start and end arguments. Returns
671671
* -1 on error, 0 if not found and 1 if found.
672672
*/
673-
Py_LOCAL(int)
673+
static int
674674
tailmatch(const char *str, Py_ssize_t len, PyObject *substr,
675675
Py_ssize_t start, Py_ssize_t end, int direction)
676676
{
@@ -716,7 +716,7 @@ tailmatch(const char *str, Py_ssize_t len, PyObject *substr,
716716
return 0;
717717
}
718718

719-
Py_LOCAL(PyObject *)
719+
static PyObject *
720720
_Py_bytes_tailmatch(const char *str, Py_ssize_t len,
721721
const char *function_name, PyObject *args,
722722
int direction)

Objects/bytesobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ bytes_item(PyBytesObject *a, Py_ssize_t i)
15001500
return PyLong_FromLong((unsigned char)a->ob_sval[i]);
15011501
}
15021502

1503-
Py_LOCAL(int)
1503+
static int
15041504
bytes_compare_eq(PyBytesObject *a, PyBytesObject *b)
15051505
{
15061506
int cmp;

Objects/stringlib/transmogrify.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* the more complicated methods. parts of these should be pulled out into the
66
shared code in bytes_methods.c to cut down on duplicate code bloat. */
77

8-
Py_LOCAL_INLINE(PyObject *)
8+
static inline PyObject *
99
return_self(PyObject *self)
1010
{
1111
#if !STRINGLIB_MUTABLE
@@ -90,7 +90,7 @@ stringlib_expandtabs(PyObject *self, PyObject *args, PyObject *kwds)
9090
return NULL;
9191
}
9292

93-
Py_LOCAL_INLINE(PyObject *)
93+
static inline PyObject *
9494
pad(PyObject *self, Py_ssize_t left, Py_ssize_t right, char fill)
9595
{
9696
PyObject *u;
@@ -212,7 +212,7 @@ stringlib_zfill(PyObject *self, PyObject *args)
212212
((char *)memchr((const void *)(target), c, target_len))
213213

214214

215-
Py_LOCAL_INLINE(Py_ssize_t)
215+
static Py_ssize_t
216216
countchar(const char *target, Py_ssize_t target_len, char c,
217217
Py_ssize_t maxcount)
218218
{
@@ -233,7 +233,7 @@ countchar(const char *target, Py_ssize_t target_len, char c,
233233
/* Algorithms for different cases of string replacement */
234234

235235
/* len(self)>=1, from="", len(to)>=1, maxcount>=1 */
236-
Py_LOCAL(PyObject *)
236+
static PyObject *
237237
stringlib_replace_interleave(PyObject *self,
238238
const char *to_s, Py_ssize_t to_len,
239239
Py_ssize_t maxcount)
@@ -304,7 +304,7 @@ stringlib_replace_interleave(PyObject *self,
304304

305305
/* Special case for deleting a single character */
306306
/* len(self)>=1, len(from)==1, to="", maxcount>=1 */
307-
Py_LOCAL(PyObject *)
307+
static PyObject *
308308
stringlib_replace_delete_single_character(PyObject *self,
309309
char from_c, Py_ssize_t maxcount)
310310
{
@@ -348,7 +348,7 @@ stringlib_replace_delete_single_character(PyObject *self,
348348

349349
/* len(self)>=1, len(from)>=2, to="", maxcount>=1 */
350350

351-
Py_LOCAL(PyObject *)
351+
static PyObject *
352352
stringlib_replace_delete_substring(PyObject *self,
353353
const char *from_s, Py_ssize_t from_len,
354354
Py_ssize_t maxcount)
@@ -400,7 +400,7 @@ stringlib_replace_delete_substring(PyObject *self,
400400
}
401401

402402
/* len(self)>=1, len(from)==len(to)==1, maxcount>=1 */
403-
Py_LOCAL(PyObject *)
403+
static PyObject *
404404
stringlib_replace_single_character_in_place(PyObject *self,
405405
char from_c, char to_c,
406406
Py_ssize_t maxcount)
@@ -447,7 +447,7 @@ stringlib_replace_single_character_in_place(PyObject *self,
447447
}
448448

449449
/* len(self)>=1, len(from)==len(to)>=2, maxcount>=1 */
450-
Py_LOCAL(PyObject *)
450+
static PyObject *
451451
stringlib_replace_substring_in_place(PyObject *self,
452452
const char *from_s, Py_ssize_t from_len,
453453
const char *to_s, Py_ssize_t to_len,
@@ -499,7 +499,7 @@ stringlib_replace_substring_in_place(PyObject *self,
499499
}
500500

501501
/* len(self)>=1, len(from)==1, len(to)>=2, maxcount>=1 */
502-
Py_LOCAL(PyObject *)
502+
static PyObject *
503503
stringlib_replace_single_character(PyObject *self,
504504
char from_c,
505505
const char *to_s, Py_ssize_t to_len,
@@ -563,7 +563,7 @@ stringlib_replace_single_character(PyObject *self,
563563
}
564564

565565
/* len(self)>=1, len(from)>=2, len(to)>=2, maxcount>=1 */
566-
Py_LOCAL(PyObject *)
566+
static PyObject *
567567
stringlib_replace_substring(PyObject *self,
568568
const char *from_s, Py_ssize_t from_len,
569569
const char *to_s, Py_ssize_t to_len,
@@ -632,7 +632,7 @@ stringlib_replace_substring(PyObject *self,
632632
}
633633

634634

635-
Py_LOCAL(PyObject *)
635+
static PyObject *
636636
stringlib_replace(PyObject *self,
637637
const char *from_s, Py_ssize_t from_len,
638638
const char *to_s, Py_ssize_t to_len,

Objects/unicodeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10936,7 +10936,7 @@ unicode_compare(PyObject *str1, PyObject *str2)
1093610936
#undef COMPARE
1093710937
}
1093810938

10939-
Py_LOCAL(int)
10939+
static int
1094010940
unicode_compare_eq(PyObject *str1, PyObject *str2)
1094110941
{
1094210942
int kind;

0 commit comments

Comments
 (0)