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

Commit 0f893de

Browse files
author
Anselm Kruis
committed
Merge tag 'v3.3.7' into 3.3-slp
Python 3.3.7
2 parents 608d34a + 17bf6b4 commit 0f893de

Some content is hidden

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

96 files changed

+24116
-7701
lines changed

.travis.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
language: c
2+
dist: trusty
3+
sudo: false
4+
group: beta
5+
6+
# To cache doc-building dependencies.
7+
cache: pip
8+
9+
branches:
10+
only:
11+
- master
12+
- /^\d\.\d$/
13+
14+
matrix:
15+
fast_finish: true
16+
allow_failures:
17+
- env: OPTIONAL=true
18+
include:
19+
- os: linux
20+
language: c
21+
compiler: clang
22+
# gcc also works, but to keep the # of concurrent builds down, we use one C
23+
# compiler here and the other to run the coverage build. Clang is preferred
24+
# in this instance for its better error messages.
25+
env: TESTING=cpython
26+
27+
# Travis provides only 2 cores, so don't overdo the parallelism and waste memory.
28+
before_script:
29+
- |
30+
set -e
31+
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.rst$)|(^Doc)|(^Misc)'
32+
then
33+
echo "Only docs were updated, stopping build process."
34+
exit
35+
fi
36+
./configure --with-pydebug
37+
make -j4
38+
39+
script:
40+
# `-r -w` implicitly provided through `make buildbottest`.
41+
- make buildbottest TESTOPTS="-j4 -uall,-cpu"
42+
43+
notifications:
44+
email: false
45+
irc:
46+
channels:
47+
# This is set to a secure variable to prevent forks from notifying the
48+
# IRC channel whenever they fail a build. This can be removed when travis
49+
# implements https://github.com/travis-ci/travis-ci/issues/1094.
50+
# The actual value here is: irc.freenode.net#python-dev
51+
- secure: "s7kAkpcom2yUJ8XqyjFI0obJmhAGrn1xmoivdaPdgBIA++X47TBp1x4pgDsbEsoalef7bEwa4l07KdT4qa+DOd/c4QxaWom7fbN3BuLVsZuVfODnl79+gYq/TAbGfyH+yDs18DXrUfPgwD7C5aW32ugsqAOd4iWzfGJQ5OrOZzqzGjYdYQUEkJFXgxDEIb4aHvxNDWGO3Po9uKISrhb5saQ0l776yLo1Ur7M4oxl8RTbCdgX0vf5TzPg52BgvZpOgt3DHOUYPeiJLKNjAE6ibg0U95sEvMfHX77nz4aFY4/3UI6FFaRla34rZ+mYKrn0TdxOhera1QOgPmM6HzdO4K44FpfK1DS0Xxk9U9/uApq+cG0bU3W+cVUHDBe5+90lpRBAXHeHCgT7TI8gec614aiT8lEr3+yH8OBRYGzkjNK8E2LJZ/SxnVxDe7aLF6AWcoWLfS6/ziAIBFQ5Nc4U72CT8fGVSkl8ywPiRlvixKdvTODMSZo0jMqlfZSNaAPTsNRx4wu5Uis4qekwe32Fz4aB6KGpsuuVjBi+H6v0RKxNJNGY3JKDiEH2TK0UE2auJ5GvLW48aUVFcQMB7euCWYXlSWVRHh3WLU8QXF29Dw4JduRZqUpOdRgMHU79UHRq+mkE0jAS/nBcS6CvsmxCpTSrfVYuMOu32yt18QQoTyU="
52+
on_success: change
53+
on_failure: always
54+
skip_join: true

Doc/Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
# You can set these variables from the command line.
77
PYTHON = python
8+
BLURB = blurb
89
SVNROOT = http://svn.python.org/projects
910
SPHINXOPTS =
1011
PAPER =
@@ -60,6 +61,19 @@ update: clean checkout
6061

6162
build: checkout
6263
mkdir -p build/$(BUILDER) build/doctrees
64+
# Look first for a Misc/NEWS file (building from a source release tarball
65+
# or old repo) and use that, otherwise look for a Misc/NEWS.d directory
66+
# (building from a newer repo) and use blurb to generate the NEWS file.
67+
@if [ -f ../Misc/NEWS ] ; then \
68+
echo "Using existing Misc/NEWS file"; \
69+
cp ../Misc/NEWS build/NEWS; \
70+
elif [ -d ../Misc/NEWS.d ]; then \
71+
echo "Building NEWS from Misc/NEWS.d with blurb"; \
72+
$(BLURB) merge -f build/NEWS; \
73+
else \
74+
echo "Neither Misc/NEWS.d nor Misc/NEWS found; cannot build docs"; \
75+
exit 1; \
76+
fi
6377
$(PYTHON) tools/sphinx-build.py $(ALLSPHINXOPTS)
6478
@echo
6579

Doc/library/argparse.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,7 @@ Action classes
12351235
Action classes implement the Action API, a callable which returns a callable
12361236
which processes arguments from the command-line. Any object which follows
12371237
this API may be passed as the ``action`` parameter to
1238-
:method:`add_argument`.
1238+
:meth:`add_argument`.
12391239

12401240
.. class:: Action(option_strings, dest, nargs=None, const=None, default=None,
12411241
type=None, choices=None, required=False, help=None,
@@ -1244,7 +1244,7 @@ this API may be passed as the ``action`` parameter to
12441244
Action objects are used by an ArgumentParser to represent the information
12451245
needed to parse a single argument from one or more strings from the
12461246
command line. The Action class must accept the two positional arguments
1247-
plus any keyword arguments passed to :method:`ArgumentParser.add_argument`
1247+
plus any keyword arguments passed to :meth:`ArgumentParser.add_argument`
12481248
except for the ``action`` itself.
12491249

12501250
Instances of Action (or return value of any callable to the ``action``

Doc/tools/sphinxext/pyspecific.py

Lines changed: 66 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,32 @@
99
:license: Python license.
1010
"""
1111

12-
ISSUE_URI = 'http://bugs.python.org/issue%s'
13-
SOURCE_URI = 'http://hg.python.org/cpython/file/3.3/%s'
12+
import re
13+
import codecs
14+
from os import path
15+
from time import asctime
16+
from pprint import pformat
17+
from docutils.io import StringOutput
18+
from docutils.parsers.rst import Directive
19+
from docutils.utils import new_document
1420

1521
from docutils import nodes, utils
1622

17-
import sphinx
23+
from sphinx import addnodes
24+
from sphinx.builders import Builder
1825
from sphinx.util.nodes import split_explicit_title
19-
from sphinx.util.compat import Directive
2026
from sphinx.writers.html import HTMLTranslator
27+
from sphinx.writers.text import TextWriter
2128
from sphinx.writers.latex import LaTeXTranslator
22-
from sphinx.locale import versionlabels
29+
from sphinx.domains.python import PyModulelevel, PyClassmember
30+
31+
# Support for checking for suspicious markup
32+
33+
import suspicious
34+
35+
36+
ISSUE_URI = 'https://bugs.python.org/issue%s'
37+
SOURCE_URI = 'https://github.com/python/cpython/tree/3.3/%s'
2338

2439
# monkey-patch reST parser to disable alphabetic and roman enumerated lists
2540
from docutils.parsers.rst.states import Body
@@ -28,23 +43,12 @@
2843
Body.enum.converters['lowerroman'] = \
2944
Body.enum.converters['upperroman'] = lambda x: None
3045

31-
SPHINX11 = sphinx.__version__[:3] < '1.2'
32-
33-
if SPHINX11:
34-
# monkey-patch HTML translator to give versionmodified paragraphs a class
35-
def new_visit_versionmodified(self, node):
36-
self.body.append(self.starttag(node, 'p', CLASS=node['type']))
37-
text = versionlabels[node['type']] % node['version']
38-
if len(node):
39-
text += ':'
40-
else:
41-
text += '.'
42-
self.body.append('<span class="versionmodified">%s</span> ' % text)
43-
HTMLTranslator.visit_versionmodified = new_visit_versionmodified
44-
4546
# monkey-patch HTML and LaTeX translators to keep doctest blocks in the
4647
# doctest docs themselves
4748
orig_visit_literal_block = HTMLTranslator.visit_literal_block
49+
orig_depart_literal_block = LaTeXTranslator.depart_literal_block
50+
51+
4852
def new_visit_literal_block(self, node):
4953
meta = self.builder.env.metadata[self.builder.current_docname]
5054
old_trim_doctest_flags = self.highlighter.trim_doctest_flags
@@ -55,9 +59,7 @@ def new_visit_literal_block(self, node):
5559
finally:
5660
self.highlighter.trim_doctest_flags = old_trim_doctest_flags
5761

58-
HTMLTranslator.visit_literal_block = new_visit_literal_block
5962

60-
orig_depart_literal_block = LaTeXTranslator.depart_literal_block
6163
def new_depart_literal_block(self, node):
6264
meta = self.builder.env.metadata[self.curfilestack[-1]]
6365
old_trim_doctest_flags = self.highlighter.trim_doctest_flags
@@ -68,8 +70,11 @@ def new_depart_literal_block(self, node):
6870
finally:
6971
self.highlighter.trim_doctest_flags = old_trim_doctest_flags
7072

73+
74+
HTMLTranslator.visit_literal_block = new_visit_literal_block
7175
LaTeXTranslator.depart_literal_block = new_depart_literal_block
7276

77+
7378
# Support for marking up and linking to bugs.python.org issues
7479

7580
def issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
@@ -117,9 +122,6 @@ def run(self):
117122

118123
# Support for documenting decorators
119124

120-
from sphinx import addnodes
121-
from sphinx.domains.python import PyModulelevel, PyClassmember
122-
123125
class PyDecoratorMixin(object):
124126
def handle_signature(self, sig, signode):
125127
ret = super(PyDecoratorMixin, self).handle_signature(sig, signode)
@@ -129,18 +131,39 @@ def handle_signature(self, sig, signode):
129131
def needs_arglist(self):
130132
return False
131133

134+
132135
class PyDecoratorFunction(PyDecoratorMixin, PyModulelevel):
133136
def run(self):
134137
# a decorator function is a function after all
135138
self.name = 'py:function'
136139
return PyModulelevel.run(self)
137140

141+
138142
class PyDecoratorMethod(PyDecoratorMixin, PyClassmember):
139143
def run(self):
140144
self.name = 'py:method'
141145
return PyClassmember.run(self)
142146

143147

148+
class PyCoroutineMixin(object):
149+
def handle_signature(self, sig, signode):
150+
ret = super(PyCoroutineMixin, self).handle_signature(sig, signode)
151+
signode.insert(0, addnodes.desc_annotation('coroutine ', 'coroutine '))
152+
return ret
153+
154+
155+
class PyCoroutineFunction(PyCoroutineMixin, PyModulelevel):
156+
def run(self):
157+
self.name = 'py:function'
158+
return PyModulelevel.run(self)
159+
160+
161+
class PyCoroutineMethod(PyCoroutineMixin, PyClassmember):
162+
def run(self):
163+
self.name = 'py:method'
164+
return PyClassmember.run(self)
165+
166+
144167
# Support for documenting version of removal in deprecations
145168

146169
class DeprecatedRemoved(Directive):
@@ -168,35 +191,31 @@ def run(self):
168191
messages = []
169192
if self.content:
170193
self.state.nested_parse(self.content, self.content_offset, node)
194+
if len(node):
171195
if isinstance(node[0], nodes.paragraph) and node[0].rawsource:
172196
content = nodes.inline(node[0].rawsource, translatable=True)
173197
content.source = node[0].source
174198
content.line = node[0].line
175199
content += node[0].children
176200
node[0].replace_self(nodes.paragraph('', '', content))
177-
if not SPHINX11:
178-
node[0].insert(0, nodes.inline('', '%s: ' % text,
179-
classes=['versionmodified']))
180-
elif not SPHINX11:
201+
node[0].insert(0, nodes.inline('', '%s: ' % text,
202+
classes=['versionmodified']))
203+
else:
181204
para = nodes.paragraph('', '',
182-
nodes.inline('', '%s.' % text, classes=['versionmodified']))
205+
nodes.inline('', '%s.' % text,
206+
classes=['versionmodified']))
183207
node.append(para)
184208
env = self.state.document.settings.env
185209
env.note_versionchange('deprecated', version[0], node, self.lineno)
186210
return [node] + messages
187211

188-
# for Sphinx < 1.2
189-
versionlabels['deprecated-removed'] = DeprecatedRemoved._label
190-
191212

192213
# Support for including Misc/NEWS
193214

194-
import re
195-
import codecs
196-
197215
issue_re = re.compile('([Ii])ssue #([0-9]+)')
198216
whatsnew_re = re.compile(r"(?im)^what's new in (.*?)\??$")
199217

218+
200219
class MiscNews(Directive):
201220
has_content = False
202221
required_arguments = 1
@@ -221,7 +240,7 @@ def run(self):
221240
text = 'The NEWS file is not available.'
222241
node = nodes.strong(text, text)
223242
return [node]
224-
content = issue_re.sub(r'`\1ssue #\2 <http://bugs.python.org/\2>`__',
243+
content = issue_re.sub(r'`\1ssue #\2 <https://bugs.python.org/\2>`__',
225244
content)
226245
content = whatsnew_re.sub(r'\1', content)
227246
# remove first 3 lines as they are the main heading
@@ -250,15 +269,6 @@ def run(self):
250269
'typesseq', 'typesseq-mutable', 'unary', 'while', 'with', 'yield'
251270
]
252271

253-
from os import path
254-
from time import asctime
255-
from pprint import pformat
256-
from docutils.io import StringOutput
257-
from docutils.utils import new_document
258-
259-
from sphinx.builders import Builder
260-
from sphinx.writers.text import TextWriter
261-
262272

263273
class PydocTopicsBuilder(Builder):
264274
name = 'pydoc-topics'
@@ -286,29 +296,23 @@ def write(self, *ignored):
286296
document.append(doctree.ids[labelid])
287297
destination = StringOutput(encoding='utf-8')
288298
writer.write(document, destination)
289-
self.topics[label] = writer.output.encode('utf-8')
299+
self.topics[label] = writer.output
290300

291301
def finish(self):
292-
f = open(path.join(self.outdir, 'topics.py'), 'w')
302+
f = open(path.join(self.outdir, 'topics.py'), 'wb')
293303
try:
294-
f.write('# -*- coding: utf-8 -*-\n')
295-
f.write('# Autogenerated by Sphinx on %s\n' % asctime())
296-
f.write('topics = ' + pformat(self.topics) + '\n')
304+
f.write('# -*- coding: utf-8 -*-\n'.encode('utf-8'))
305+
f.write(('# Autogenerated by Sphinx on %s\n' % asctime()).encode('utf-8'))
306+
f.write(('topics = ' + pformat(self.topics) + '\n').encode('utf-8'))
297307
finally:
298308
f.close()
299309

300310

301-
# Support for checking for suspicious markup
302-
303-
import suspicious
304-
305-
306311
# Support for documenting Opcodes
307312

308-
import re
309-
310313
opcode_sig_re = re.compile(r'(\w+(?:\+\d)?)(?:\s*\((.*)\))?')
311314

315+
312316
def parse_opcode_signature(env, sig, signode):
313317
"""Transform an opcode signature into RST nodes."""
314318
m = opcode_sig_re.match(sig)
@@ -328,12 +332,13 @@ def parse_opcode_signature(env, sig, signode):
328332
pdbcmd_sig_re = re.compile(r'([a-z()!]+)\s*(.*)')
329333

330334
# later...
331-
#pdbargs_tokens_re = re.compile(r'''[a-zA-Z]+ | # identifiers
335+
# pdbargs_tokens_re = re.compile(r'''[a-zA-Z]+ | # identifiers
332336
# [.,:]+ | # punctuation
333337
# [\[\]()] | # parens
334338
# \s+ # whitespace
335339
# ''', re.X)
336340

341+
337342
def parse_pdb_command(env, sig, signode):
338343
"""Transform a pdb command signature into RST nodes."""
339344
m = pdbcmd_sig_re.match(sig)
@@ -361,4 +366,7 @@ def setup(app):
361366
app.add_description_unit('2to3fixer', '2to3fixer', '%s (2to3 fixer)')
362367
app.add_directive_to_domain('py', 'decorator', PyDecoratorFunction)
363368
app.add_directive_to_domain('py', 'decoratormethod', PyDecoratorMethod)
369+
app.add_directive_to_domain('py', 'coroutinefunction', PyCoroutineFunction)
370+
app.add_directive_to_domain('py', 'coroutinemethod', PyCoroutineMethod)
364371
app.add_directive('miscnews', MiscNews)
372+
return {'version': '1.0', 'parallel_read_safe': True}

Doc/tools/sphinxext/static/version_switch.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
'use strict';
33

44
var all_versions = {
5-
'3.5': 'dev (3.5)',
5+
'3.7': 'dev (3.7)',
6+
'3.6': '3.6',
7+
'3.5': '3.5',
68
'3.4': '3.4',
79
'3.3': '3.3',
8-
'3.2': '3.2',
9-
'2.7': '2.7',
10-
'2.6': '2.6'
10+
'2.7': '2.7'
1111
};
1212

1313
function build_select(current_version, current_release) {

0 commit comments

Comments
 (0)