[Python-checkins] cpython (merge default -> default): merge
christian.heimes
python-checkins at python.org
Mon Sep 12 04:49:03 EDT 2016
https://hg.python.org/cpython/rev/0ae87198fe54
changeset: 103698:0ae87198fe54
parent: 103697:cf2689e191f8
parent: 103696:c8851a0ce7ca
user: Christian Heimes <christian at python.org>
date: Mon Sep 12 10:48:55 2016 +0200
summary:
merge
files:
Doc/library/collections.rst | 7 +-
Doc/library/dis.rst | 4 +
Doc/library/idle.rst | 3 +
Doc/library/time.rst | 8 +-
Doc/reference/expressions.rst | 5 +-
Lib/asyncio/base_subprocess.py | 6 +
Lib/asyncio/proactor_events.py | 6 +
Lib/asyncio/selector_events.py | 22 +
Lib/asyncio/sslproto.py | 6 +
Lib/asyncio/transports.py | 8 +
Lib/asyncio/unix_events.py | 12 +
Lib/collections/__init__.py | 16 +-
Lib/idlelib/NEWS.txt | 3 +
Lib/idlelib/README.txt | 9 +-
Lib/idlelib/help.html | 62 ++-
Lib/idlelib/mainmenu.py | 2 +
Lib/test/test_asyncio/test_sslproto.py | 1 +
Lib/test/test_collections.py | 4 +
Lib/test/test_getargs2.py | 2 +-
Lib/test/test_site.py | 4 +-
Lib/test/test_xml_etree.py | 8 +
Lib/xml/etree/ElementTree.py | 11 +
Misc/ACKS | 1 +
Misc/NEWS | 26 +
Modules/_collectionsmodule.c | 52 ++-
Modules/_sqlite/connection.c | 31 +-
Modules/_sqlite/connection.h | 4 -
Modules/_sqlite/cursor.c | 9 -
Modules/posixmodule.c | 4 +
Modules/timemodule.c | 114 ++++-
Objects/rangeobject.c | 2 +-
Objects/setobject.c | 8 +
PCbuild/_lzma.vcxproj | 12 +-
PCbuild/get_externals.bat | 2 +-
PCbuild/liblzma.vcxproj | 216 +++++++++++++
PCbuild/pyproject.props | 1 -
PCbuild/python.props | 3 +-
Tools/msi/buildrelease.bat | 9 +-
configure | 2 +-
configure.ac | 2 +-
40 files changed, 579 insertions(+), 128 deletions(-)
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -763,7 +763,7 @@
self-documenting code. They can be used wherever regular tuples are used, and
they add the ability to access fields by name instead of position index.
-.. function:: namedtuple(typename, field_names, *, verbose=False, rename=False)
+.. function:: namedtuple(typename, field_names, *, verbose=False, rename=False, module=None)
Returns a new tuple subclass named *typename*. The new subclass is used to
create tuple-like objects that have fields accessible by attribute lookup as
@@ -790,6 +790,9 @@
built. This option is outdated; instead, it is simpler to print the
:attr:`_source` attribute.
+ If *module* is defined, the ``__module__`` attribute of the named tuple is
+ set to that value.
+
Named tuple instances do not have per-instance dictionaries, so they are
lightweight and require no more memory than regular tuples.
@@ -800,6 +803,8 @@
The *verbose* and *rename* parameters became
:ref:`keyword-only arguments <keyword-only_parameter>`.
+ .. versionchanged:: 3.6
+ Added the *module* parameter.
.. doctest::
:options: +NORMALIZE_WHITESPACE
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst
--- a/Doc/library/dis.rst
+++ b/Doc/library/dis.rst
@@ -614,6 +614,8 @@
or module body contains :term:`variable annotations <variable annotation>`
statically.
+ .. versionadded:: 3.6
+
.. opcode:: IMPORT_STAR
Loads all symbols not starting with ``'_'`` directly from the module TOS to
@@ -900,6 +902,8 @@
Stores TOS as ``locals()['__annotations__'][co_names[namei]] = TOS``.
+ .. versionadded:: 3.6
+
.. opcode:: LOAD_CLOSURE (i)
diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst
--- a/Doc/library/idle.rst
+++ b/Doc/library/idle.rst
@@ -226,6 +226,9 @@
Restart Shell
Restart the shell to clean the environment.
+Interrupt Execution
+ Stop a running program.
+
Debug menu (Shell window only)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/Doc/library/time.rst b/Doc/library/time.rst
--- a/Doc/library/time.rst
+++ b/Doc/library/time.rst
@@ -83,6 +83,10 @@
and :attr:`tm_zone` attributes when platform supports corresponding
``struct tm`` members.
+ .. versionchanged:: 3.6
+ The :class:`struct_time` attributes :attr:`tm_gmtoff` and :attr:`tm_zone`
+ are now available on all platforms.
+
* Use the following functions to convert between time representations:
+-------------------------+-------------------------+-------------------------+
@@ -566,10 +570,6 @@
:class:`struct_time`, or having elements of the wrong type, a
:exc:`TypeError` is raised.
- .. versionchanged:: 3.3
- :attr:`tm_gmtoff` and :attr:`tm_zone` attributes are available on platforms
- with C library supporting the corresponding fields in ``struct tm``.
-
.. function:: time()
Return the time in seconds since the epoch as a floating point number.
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -1315,8 +1315,9 @@
--------------------
The operators :keyword:`is` and :keyword:`is not` test for object identity: ``x
-is y`` is true if and only if *x* and *y* are the same object. ``x is not y``
-yields the inverse truth value. [#]_
+is y`` is true if and only if *x* and *y* are the same object. Object identity
+is determined using the :meth:`id` function. ``x is not y`` yields the inverse
+truth value. [#]_
.. _booleans:
diff --git a/Lib/asyncio/base_subprocess.py b/Lib/asyncio/base_subprocess.py
--- a/Lib/asyncio/base_subprocess.py
+++ b/Lib/asyncio/base_subprocess.py
@@ -87,6 +87,12 @@
def _start(self, args, shell, stdin, stdout, stderr, bufsize, **kwargs):
raise NotImplementedError
+ def set_protocol(self, protocol):
+ self._protocol = protocol
+
+ def get_protocol(self):
+ return self._protocol
+
def is_closing(self):
return self._closed
diff --git a/Lib/asyncio/proactor_events.py b/Lib/asyncio/proactor_events.py
--- a/Lib/asyncio/proactor_events.py
+++ b/Lib/asyncio/proactor_events.py
@@ -66,6 +66,12 @@
def _set_extra(self, sock):
self._extra['pipe'] = sock
+ def set_protocol(self, protocol):
+ self._protocol = protocol
+
+ def get_protocol(self):
+ return self._protocol
+
def is_closing(self):
return self._closing
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py
--- a/Lib/asyncio/selector_events.py
+++ b/Lib/asyncio/selector_events.py
@@ -39,6 +39,17 @@
return bool(key.events & event)
+if hasattr(socket, 'TCP_NODELAY'):
+ def _set_nodelay(sock):
+ if (sock.family in {socket.AF_INET, socket.AF_INET6} and
+ sock.type == socket.SOCK_STREAM and
+ sock.proto == socket.IPPROTO_TCP):
+ sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
+else:
+ def _set_nodelay(sock):
+ pass
+
+
class BaseSelectorEventLoop(base_events.BaseEventLoop):
"""Selector event loop.
@@ -560,6 +571,12 @@
def abort(self):
self._force_close(None)
+ def set_protocol(self, protocol):
+ self._protocol = protocol
+
+ def get_protocol(self):
+ return self._protocol
+
def is_closing(self):
return self._closing
@@ -635,6 +652,11 @@
self._eof = False
self._paused = False
+ # Disable the Nagle algorithm -- small writes will be
+ # sent without waiting for the TCP ACK. This generally
+ # decreases the latency (in some cases significantly.)
+ _set_nodelay(self._sock)
+
self._loop.call_soon(self._protocol.connection_made, self)
# only start reading when connection_made() has been called
self._loop.call_soon(self._loop.add_reader,
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py
--- a/Lib/asyncio/sslproto.py
+++ b/Lib/asyncio/sslproto.py
@@ -305,6 +305,12 @@
"""Get optional transport information."""
return self._ssl_protocol._get_extra_info(name, default)
+ def set_protocol(self, protocol):
+ self._app_protocol = protocol
+
+ def get_protocol(self):
+ return self._app_protocol
+
def is_closing(self):
return self._closed
diff --git a/Lib/asyncio/transports.py b/Lib/asyncio/transports.py
--- a/Lib/asyncio/transports.py
+++ b/Lib/asyncio/transports.py
@@ -33,6 +33,14 @@
"""
raise NotImplementedError
+ def set_protocol(self, protocol):
+ """Set a new protocol."""
+ raise NotImplementedError
+
+ def get_protocol(self):
+ """Return the current protocol."""
+ raise NotImplementedError
+
class ReadTransport(BaseTransport):
"""Interface for read-only transports."""
diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py
--- a/Lib/asyncio/unix_events.py
+++ b/Lib/asyncio/unix_events.py
@@ -374,6 +374,12 @@
def resume_reading(self):
self._loop.add_reader(self._fileno, self._read_ready)
+ def set_protocol(self, protocol):
+ self._protocol = protocol
+
+ def get_protocol(self):
+ return self._protocol
+
def is_closing(self):
return self._closing
@@ -571,6 +577,12 @@
self._loop.remove_reader(self._fileno)
self._loop.call_soon(self._call_connection_lost, None)
+ def set_protocol(self, protocol):
+ self._protocol = protocol
+
+ def get_protocol(self):
+ return self._protocol
+
def is_closing(self):
return self._closing
diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py
--- a/Lib/collections/__init__.py
+++ b/Lib/collections/__init__.py
@@ -353,7 +353,7 @@
{name} = _property(_itemgetter({index:d}), doc='Alias for field number {index:d}')
'''
-def namedtuple(typename, field_names, *, verbose=False, rename=False):
+def namedtuple(typename, field_names, *, verbose=False, rename=False, module=None):
"""Returns a new subclass of tuple with named fields.
>>> Point = namedtuple('Point', ['x', 'y'])
@@ -434,11 +434,15 @@
# For pickling to work, the __module__ variable needs to be set to the frame
# where the named tuple is created. Bypass this step in environments where
# sys._getframe is not defined (Jython for example) or sys._getframe is not
- # defined for arguments greater than 0 (IronPython).
- try:
- result.__module__ = _sys._getframe(1).f_globals.get('__name__', '__main__')
- except (AttributeError, ValueError):
- pass
+ # defined for arguments greater than 0 (IronPython), or where the user has
+ # specified a particular module.
+ if module is None:
+ try:
+ module = _sys._getframe(1).f_globals.get('__name__', '__main__')
+ except (AttributeError, ValueError):
+ pass
+ if module is not None:
+ result.__module__ = module
return result
diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt
--- a/Lib/idlelib/NEWS.txt
+++ b/Lib/idlelib/NEWS.txt
@@ -2,6 +2,9 @@
===========================
*Release date: 2016-12-16?*
+- Issue #15308: Add 'interrupt execution' (^C) to Shell menu.
+ Patch by Roger Serwy, updated by Bayard Randel.
+
- Issue #27922: Stop IDLE tests from 'flashing' gui widgets on the screen.
- Issue #27891: Consistently group and sort imports within idlelib modules.
diff --git a/Lib/idlelib/README.txt b/Lib/idlelib/README.txt
--- a/Lib/idlelib/README.txt
+++ b/Lib/idlelib/README.txt
@@ -160,13 +160,14 @@
Show surrounding parens # parenmatch (& Hyperparser)
Shell # pyshell
- View Last Restart# pyshell.?
- Restart Shell # pyshell.?
+ View Last Restart # pyshell.PyShell.view_restart_mark
+ Restart Shell # pyshell.PyShell.restart_shell
+ Interrupt Execution # pyshell.PyShell.cancel_callback
Debug (Shell only)
Go to File/Line
- debugger # debugger, debugger_r
- Stack Viewer # stackviewer
+ debugger # debugger, debugger_r, PyShell.toggle_debuger
+ Stack Viewer # stackviewer, PyShell.open_stack_viewer
Auto-open Stack Viewer # stackviewer
Format (Editor only)
diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html
--- a/Lib/idlelib/help.html
+++ b/Lib/idlelib/help.html
@@ -65,6 +65,21 @@
<li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li>
<li class="nav-item nav-item-2"><a href="tk.html" accesskey="U">25. Graphical User Interfaces with Tk</a> »</li>
+ <li class="right">
+
+
+ <div class="inline-search" style="display: none" role="search">
+ <form class="inline-search" action="../search.html" method="get">
+ <input placeholder="Quick search" type="text" name="q" />
+ <input type="submit" value="Go" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+ </div>
+ <script type="text/javascript">$('.inline-search').show(0);</script>
+ |
+ </li>
+
</ul>
</div>
@@ -240,6 +255,8 @@
<dd>Scroll the shell window to the last Shell restart.</dd>
<dt>Restart Shell</dt>
<dd>Restart the shell to clean the environment.</dd>
+<dt>Interrupt Execution</dt>
+<dd>Stop a running program.</dd>
</dl>
</div>
<div class="section" id="debug-menu-shell-window-only">
@@ -649,26 +666,14 @@
<h4>Next topic</h4>
<p class="topless"><a href="othergui.html"
title="next chapter">25.6. Other Graphical User Interface Packages</a></p>
-<h3>This Page</h3>
-<ul class="this-page-menu">
- <li><a href="../bugs.html">Report a Bug</a></li>
- <li><a href="../_sources/library/idle.txt"
- rel="nofollow">Show Source</a></li>
-</ul>
-
-<div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="../search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- <p class="searchtip" style="font-size: 90%">
- Enter search terms or a module, class or function name.
- </p>
-</div>
-<script type="text/javascript">$('#searchbox').show(0);</script>
+ <div role="note" aria-label="source link">
+ <h3>This Page</h3>
+ <ul class="this-page-menu">
+ <li><a href="../bugs.html">Report a Bug</a></li>
+ <li><a href="../_sources/library/idle.txt"
+ rel="nofollow">Show Source</a></li>
+ </ul>
+ </div>
</div>
</div>
<div class="clearer"></div>
@@ -697,6 +702,21 @@
<li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li>
<li class="nav-item nav-item-2"><a href="tk.html" >25. Graphical User Interfaces with Tk</a> »</li>
+ <li class="right">
+
+
+ <div class="inline-search" style="display: none" role="search">
+ <form class="inline-search" action="../search.html" method="get">
+ <input placeholder="Quick search" type="text" name="q" />
+ <input type="submit" value="Go" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+ </div>
+ <script type="text/javascript">$('.inline-search').show(0);</script>
+ |
+ </li>
+
</ul>
</div>
<div class="footer">
@@ -705,7 +725,7 @@
The Python Software Foundation is a non-profit corporation.
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
- Last updated on Aug 30, 2016.
+ Last updated on Sep 12, 2016.
<a href="../bugs.html">Found a bug</a>?
<br />
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.3.6.
diff --git a/Lib/idlelib/mainmenu.py b/Lib/idlelib/mainmenu.py
--- a/Lib/idlelib/mainmenu.py
+++ b/Lib/idlelib/mainmenu.py
@@ -69,6 +69,8 @@
('shell', [
('_View Last Restart', '<<view-restart>>'),
('_Restart Shell', '<<restart-shell>>'),
+ None,
+ ('_Interrupt Execution', '<<interrupt-execution>>'),
]),
('debug', [
('_Go to File/Line', '<<goto-file-line>>'),
diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py
--- a/Lib/test/test_asyncio/test_sslproto.py
+++ b/Lib/test/test_asyncio/test_sslproto.py
@@ -25,6 +25,7 @@
sslcontext = test_utils.dummy_ssl_context()
app_proto = asyncio.Protocol()
proto = sslproto.SSLProtocol(self.loop, app_proto, sslcontext, waiter)
+ self.assertIs(proto._app_transport.get_protocol(), app_proto)
self.addCleanup(proto._app_transport.close)
return proto
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -242,6 +242,10 @@
]:
self.assertEqual(namedtuple('NT', spec, rename=True)._fields, renamed)
+ def test_module_parameter(self):
+ NT = namedtuple('NT', ['x', 'y'], module=collections)
+ self.assertEqual(NT.__module__, collections)
+
def test_instance(self):
Point = namedtuple('Point', 'x y')
p = Point(11, 22)
diff --git a/Lib/test/test_getargs2.py b/Lib/test/test_getargs2.py
--- a/Lib/test/test_getargs2.py
+++ b/Lib/test/test_getargs2.py
@@ -471,7 +471,7 @@
ret = get_args(*TupleSubclass([1, 2]))
self.assertEqual(ret, (1, 2))
- self.assertIs(type(ret), tuple)
+ self.assertIsInstance(ret, tuple)
ret = get_args()
self.assertIn(ret, ((), None))
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -470,7 +470,9 @@
'heapq', 'itertools', 'keyword', 'operator',
'reprlib', 'types', 'weakref'
}.difference(sys.builtin_module_names)
- self.assertFalse(modules.intersection(collection_mods), stderr)
+ # http://bugs.python.org/issue28095
+ if sys.platform != 'darwin':
+ self.assertFalse(modules.intersection(collection_mods), stderr)
if __name__ == "__main__":
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -409,6 +409,14 @@
self.assertEqual(ET.tostring(elem),
b'<test testa="testval" testb="test1" testc="test2">aa</test>')
+ elem = ET.Element('test')
+ elem.set('a', '\r')
+ elem.set('b', '\r\n')
+ elem.set('c', '\t\n\r ')
+ elem.set('d', '\n\n')
+ self.assertEqual(ET.tostring(elem),
+ b'<test a="
" b="
" c="
" d="
" />')
+
def test_makeelement(self):
# Test makeelement handling.
diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py
--- a/Lib/xml/etree/ElementTree.py
+++ b/Lib/xml/etree/ElementTree.py
@@ -1084,8 +1084,19 @@
text = text.replace(">", ">")
if "\"" in text:
text = text.replace("\"", """)
+ # The following business with carriage returns is to satisfy
+ # Section 2.11 of the XML specification, stating that
+ # CR or CR LN should be replaced with just LN
+ # http://www.w3.org/TR/REC-xml/#sec-line-ends
+ if "\r\n" in text:
+ text = text.replace("\r\n", "\n")
+ if "\r" in text:
+ text = text.replace("\r", "\n")
+ #The following four lines are issue 17582
if "\n" in text:
text = text.replace("\n", "
")
+ if "\t" in text:
+ text = text.replace("\t", " ")
return text
except (TypeError, AttributeError):
_raise_serialization_error(text)
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1209,6 +1209,7 @@
Abhilash Raj
Shorya Raj
Jeff Ramnani
+Bayard Randel
Varpu Rantala
Brodie Rao
Rémi Rampin
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -33,6 +33,8 @@
- Issue #28046: Remove platform-specific directories from sys.path.
+- Issue #28071: Add early-out for differencing from an empty set.
+
- Issue #25758: Prevents zipimport from unnecessarily encoding a filename
(patch by Eryk Sun)
@@ -143,6 +145,13 @@
Library
-------
+- Issue #28037: Use sqlite3_get_autocommit() instead of setting
+ Connection->inTransaction manually.
+
+- Issue #25283: Attributes tm_gmtoff and tm_zone are now available on
+ all platforms in the return values of time.localtime() and
+ time.gmtime().
+
- Issue #24454: Regular expression match object groups are now
accessible using __getitem__. "mo[x]" is equivalent to
"mo.group(x)".
@@ -150,6 +159,8 @@
- Issue #10740: sqlite3 no longer implicitly commit an open transaction
before DDL statements.
+- Issue #17941: Add a *module* parameter to collections.namedtuple().
+
- Issue #22493: Inline flags now should be used only at the start of the
regular expression. Deprecation warning is emitted if uses them in the
middle of the regular expression.
@@ -200,6 +211,9 @@
- Issue #24594: Validates persist parameter when opening MSI database
+- Issue #17582: xml.etree.ElementTree nows preserves whitespaces in attributes
+ (Patch by Duane Griffin. Reviewed and approved by Stefan Behnel.)
+
- Issue #28047: Fixed calculation of line length used for the base64 CTE
in the new email policies.
@@ -363,9 +377,16 @@
- Issue #21201: Improves readability of multiprocessing error message. Thanks
to Wojciech Walczak for patch.
+- asyncio: Add set_protocol / get_protocol to Transports.
+
+- Issue #27456: asyncio: Set TCP_NODELAY by default.
+
IDLE
----
+- Issue #15308: Add 'interrupt execution' (^C) to Shell menu.
+ Patch by Roger Serwy, updated by Bayard Randel.
+
- Issue #27922: Stop IDLE tests from 'flashing' gui widgets on the screen.
- Issue #27891: Consistently group and sort imports within idlelib modules.
@@ -443,6 +464,8 @@
Windows
-------
+- Issue #28065: Update xz dependency to 5.2.2 and build it from source.
+
- Issue #25144: Ensures TargetDir is set before continuing with custom
install.
@@ -868,6 +891,9 @@
Build
-----
+- Issue #28066: Fix the logic that searches build directories for generated
+ include files when building outside the source tree.
+
- Issue #27442: Expose the Android API level that python was built against, in
sysconfig.get_config_vars() as 'ANDROID_API_LEVEL'.
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -403,10 +403,28 @@
iternext = *Py_TYPE(it)->tp_iternext;
while ((item = iternext(it)) != NULL) {
- if (deque_append_internal(deque, item, maxlen) < 0) {
- Py_DECREF(item);
- Py_DECREF(it);
- return NULL;
+ if (deque->rightindex == BLOCKLEN - 1) {
+ block *b = newblock();
+ if (b == NULL) {
+ Py_DECREF(item);
+ Py_DECREF(it);
+ return NULL;
+ }
+ b->leftlink = deque->rightblock;
+ CHECK_END(deque->rightblock->rightlink);
+ deque->rightblock->rightlink = b;
+ deque->rightblock = b;
+ MARK_END(b->rightlink);
+ deque->rightindex = -1;
+ }
+ Py_SIZE(deque)++;
+ deque->rightindex++;
+ deque->rightblock->data[deque->rightindex] = item;
+ if (NEEDS_TRIM(deque, maxlen)) {
+ PyObject *olditem = deque_popleft(deque, NULL);
+ Py_DECREF(olditem);
+ } else {
+ deque->state++;
}
}
return finalize_iterator(it);
@@ -450,10 +468,28 @@
iternext = *Py_TYPE(it)->tp_iternext;
while ((item = iternext(it)) != NULL) {
- if (deque_appendleft_internal(deque, item, maxlen) < 0) {
- Py_DECREF(item);
- Py_DECREF(it);
- return NULL;
+ if (deque->leftindex == 0) {
+ block *b = newblock();
+ if (b == NULL) {
+ Py_DECREF(item);
+ Py_DECREF(it);
+ return NULL;
+ }
+ b->rightlink = deque->leftblock;
+ CHECK_END(deque->leftblock->leftlink);
+ deque->leftblock->leftlink = b;
+ deque->leftblock = b;
+ MARK_END(b->leftlink);
+ deque->leftindex = BLOCKLEN;
+ }
+ Py_SIZE(deque)++;
+ deque->leftindex--;
+ deque->leftblock->data[deque->leftindex] = item;
+ if (NEEDS_TRIM(deque, maxlen)) {
+ PyObject *olditem = deque_pop(deque, NULL);
+ Py_DECREF(olditem);
+ } else {
+ deque->state++;
}
}
return finalize_iterator(it);
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -165,7 +165,6 @@
self->statement_cache->decref_factory = 0;
Py_DECREF(self);
- self->inTransaction = 0;
self->detect_types = detect_types;
self->timeout = timeout;
(void)sqlite3_busy_timeout(self->db, (int)(timeout*1000));
@@ -385,9 +384,7 @@
}
rc = pysqlite_step(statement, self);
- if (rc == SQLITE_DONE) {
- self->inTransaction = 1;
- } else {
+ if (rc != SQLITE_DONE) {
_pysqlite_seterror(self->db, statement);
}
@@ -418,7 +415,7 @@
return NULL;
}
- if (self->inTransaction) {
+ if (!sqlite3_get_autocommit(self->db)) {
Py_BEGIN_ALLOW_THREADS
rc = sqlite3_prepare(self->db, "COMMIT", -1, &statement, &tail);
@@ -429,9 +426,7 @@
}
rc = pysqlite_step(statement, self);
- if (rc == SQLITE_DONE) {
- self->inTransaction = 0;
- } else {
+ if (rc != SQLITE_DONE) {
_pysqlite_seterror(self->db, statement);
}
@@ -463,7 +458,7 @@
return NULL;
}
- if (self->inTransaction) {
+ if (!sqlite3_get_autocommit(self->db)) {
pysqlite_do_all_statements(self, ACTION_RESET, 1);
Py_BEGIN_ALLOW_THREADS
@@ -475,9 +470,7 @@
}
rc = pysqlite_step(statement, self);
- if (rc == SQLITE_DONE) {
- self->inTransaction = 0;
- } else {
+ if (rc != SQLITE_DONE) {
_pysqlite_seterror(self->db, statement);
}
@@ -1158,6 +1151,17 @@
}
}
+static PyObject* pysqlite_connection_get_in_transaction(pysqlite_Connection* self, void* unused)
+{
+ if (!pysqlite_check_connection(self)) {
+ return NULL;
+ }
+ if (!sqlite3_get_autocommit(self->db)) {
+ Py_RETURN_TRUE;
+ }
+ Py_RETURN_FALSE;
+}
+
static int pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level)
{
if (isolation_level == Py_None) {
@@ -1168,7 +1172,6 @@
Py_DECREF(res);
self->begin_statement = NULL;
- self->inTransaction = 0;
} else {
const char * const *candidate;
PyObject *uppercase_level;
@@ -1606,6 +1609,7 @@
static PyGetSetDef connection_getset[] = {
{"isolation_level", (getter)pysqlite_connection_get_isolation_level, (setter)pysqlite_connection_set_isolation_level},
{"total_changes", (getter)pysqlite_connection_get_total_changes, (setter)0},
+ {"in_transaction", (getter)pysqlite_connection_get_in_transaction, (setter)0},
{NULL}
};
@@ -1667,7 +1671,6 @@
{"NotSupportedError", T_OBJECT, offsetof(pysqlite_Connection, NotSupportedError), READONLY},
{"row_factory", T_OBJECT, offsetof(pysqlite_Connection, row_factory)},
{"text_factory", T_OBJECT, offsetof(pysqlite_Connection, text_factory)},
- {"in_transaction", T_BOOL, offsetof(pysqlite_Connection, inTransaction), READONLY},
{NULL}
};
diff --git a/Modules/_sqlite/connection.h b/Modules/_sqlite/connection.h
--- a/Modules/_sqlite/connection.h
+++ b/Modules/_sqlite/connection.h
@@ -37,10 +37,6 @@
PyObject_HEAD
sqlite3* db;
- /* 1 if we are currently within a transaction, i. e. if a BEGIN has been
- * issued */
- char inTransaction;
-
/* the type detection mode. Only 0, PARSE_DECLTYPES, PARSE_COLNAMES or a
* bitwise combination thereof makes sense */
int detect_types;
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c
--- a/Modules/_sqlite/cursor.c
+++ b/Modules/_sqlite/cursor.c
@@ -644,15 +644,6 @@
}
error:
- /* just to be sure (implicit ROLLBACKs with ON CONFLICT ROLLBACK/OR
- * ROLLBACK could have happened */
- #ifdef SQLITE_VERSION_NUMBER
- #if SQLITE_VERSION_NUMBER >= 3002002
- if (self->connection && self->connection->db)
- self->connection->inTransaction = !sqlite3_get_autocommit(self->connection->db);
- #endif
- #endif
-
Py_XDECREF(parameters);
Py_XDECREF(parameters_iter);
Py_XDECREF(parameters_list);
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -5030,11 +5030,13 @@
mode = _P_OVERLAY;
Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
#ifdef HAVE_WSPAWNV
spawnval = _wspawnv(mode, path->wide, argvlist);
#else
spawnval = _spawnv(mode, path->narrow, argvlist);
#endif
+ _Py_END_SUPPRESS_IPH
Py_END_ALLOW_THREADS
free_string_array(argvlist, argc);
@@ -5122,11 +5124,13 @@
mode = _P_OVERLAY;
Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
#ifdef HAVE_WSPAWNV
spawnval = _wspawnve(mode, path->wide, argvlist, envlist);
#else
spawnval = _spawnve(mode, path->narrow, argvlist, envlist);
#endif
+ _Py_END_SUPPRESS_IPH
Py_END_ALLOW_THREADS
if (spawnval == -1)
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -250,10 +250,8 @@
{"tm_wday", "day of week, range [0, 6], Monday is 0"},
{"tm_yday", "day of year, range [1, 366]"},
{"tm_isdst", "1 if summer time is in effect, 0 if not, and -1 if unknown"},
-#ifdef HAVE_STRUCT_TM_TM_ZONE
{"tm_zone", "abbreviation of timezone name"},
{"tm_gmtoff", "offset from UTC in seconds"},
-#endif /* HAVE_STRUCT_TM_TM_ZONE */
{0}
};
@@ -275,7 +273,11 @@
static PyObject *
-tmtotuple(struct tm *p)
+tmtotuple(struct tm *p
+#ifndef HAVE_STRUCT_TM_TM_ZONE
+ , const char *zone, int gmtoff
+#endif
+)
{
PyObject *v = PyStructSequence_New(&StructTimeType);
if (v == NULL)
@@ -296,6 +298,10 @@
PyStructSequence_SET_ITEM(v, 9,
PyUnicode_DecodeLocale(p->tm_zone, "surrogateescape"));
SET(10, p->tm_gmtoff);
+#else
+ PyStructSequence_SET_ITEM(v, 9,
+ PyUnicode_DecodeLocale(zone, "surrogateescape"));
+ SET(10, gmtoff);
#endif /* HAVE_STRUCT_TM_TM_ZONE */
#undef SET
if (PyErr_Occurred()) {
@@ -348,9 +354,26 @@
return PyErr_SetFromErrno(PyExc_OSError);
}
buf = *local;
+#ifdef HAVE_STRUCT_TM_TM_ZONE
return tmtotuple(&buf);
+#else
+ return tmtotuple(&buf, "UTC", 0);
+#endif
}
+#ifndef HAVE_TIMEGM
+static time_t
+timegm(struct tm *p)
+{
+ /* XXX: the following implementation will not work for tm_year < 1970.
+ but it is likely that platforms that don't have timegm do not support
+ negative timestamps anyways. */
+ return p->tm_sec + p->tm_min*60 + p->tm_hour*3600 + p->tm_yday*86400 +
+ (p->tm_year-70)*31536000 + ((p->tm_year-69)/4)*86400 -
+ ((p->tm_year-1)/100)*86400 + ((p->tm_year+299)/400)*86400;
+}
+#endif
+
PyDoc_STRVAR(gmtime_doc,
"gmtime([seconds]) -> (tm_year, tm_mon, tm_mday, tm_hour, tm_min,\n\
tm_sec, tm_wday, tm_yday, tm_isdst)\n\
@@ -391,7 +414,18 @@
return NULL;
if (pylocaltime(&when, &buf) == -1)
return NULL;
+#ifdef HAVE_STRUCT_TM_TM_ZONE
return tmtotuple(&buf);
+#else
+ {
+ struct tm local = buf;
+ char zone[100];
+ int gmtoff;
+ strftime(zone, sizeof(buf), "%Z", &buf);
+ gmtoff = timegm(&buf) - when;
+ return tmtotuple(&local, zone, gmtoff);
+ }
+#endif
}
PyDoc_STRVAR(localtime_doc,
@@ -1146,6 +1180,27 @@
Get information of the specified clock.");
static void
+get_zone(char *zone, int n, struct tm *p)
+{
+#ifdef HAVE_STRUCT_TM_TM_ZONE
+ strncpy(zone, p->tm_zone ? p->tm_zone : " ", n);
+#else
+ tzset();
+ strftime(zone, n, "%Z", p);
+#endif
+}
+
+static int
+get_gmtoff(time_t t, struct tm *p)
+{
+#ifdef HAVE_STRUCT_TM_TM_ZONE
+ return p->tm_gmtoff;
+#else
+ return timegm(p) - t;
+#endif
+}
+
+static void
PyInit_timezone(PyObject *m) {
/* This code moved from PyInit_time wholesale to allow calling it from
time_tzset. In the future, some parts of it can be moved back
@@ -1177,7 +1232,6 @@
otz1 = PyUnicode_DecodeLocale(tzname[1], "surrogateescape");
PyModule_AddObject(m, "tzname", Py_BuildValue("(NN)", otz0, otz1));
#else /* !HAVE_TZNAME || __GLIBC__ || __CYGWIN__*/
-#ifdef HAVE_STRUCT_TM_TM_ZONE
{
#define YEAR ((time_t)((365 * 24 + 6) * 3600))
time_t t;
@@ -1186,13 +1240,13 @@
char janname[10], julyname[10];
t = (time((time_t *)0) / YEAR) * YEAR;
p = localtime(&t);
- janzone = -p->tm_gmtoff;
- strncpy(janname, p->tm_zone ? p->tm_zone : " ", 9);
+ get_zone(janname, 9, p);
+ janzone = -get_gmtoff(t, p);
janname[9] = '\0';
t += YEAR/2;
p = localtime(&t);
- julyzone = -p->tm_gmtoff;
- strncpy(julyname, p->tm_zone ? p->tm_zone : " ", 9);
+ get_zone(julyname, 9, p);
+ julyzone = -get_gmtoff(t, p);
julyname[9] = '\0';
if( janzone < julyzone ) {
@@ -1214,8 +1268,6 @@
janname, julyname));
}
}
-#else
-#endif /* HAVE_STRUCT_TM_TM_ZONE */
#ifdef __CYGWIN__
tzset();
PyModule_AddIntConstant(m, "timezone", _timezone);
@@ -1225,25 +1277,6 @@
Py_BuildValue("(zz)", _tzname[0], _tzname[1]));
#endif /* __CYGWIN__ */
#endif /* !HAVE_TZNAME || __GLIBC__ || __CYGWIN__*/
-
-#if defined(HAVE_CLOCK_GETTIME)
- PyModule_AddIntMacro(m, CLOCK_REALTIME);
-#ifdef CLOCK_MONOTONIC
- PyModule_AddIntMacro(m, CLOCK_MONOTONIC);
-#endif
-#ifdef CLOCK_MONOTONIC_RAW
- PyModule_AddIntMacro(m, CLOCK_MONOTONIC_RAW);
-#endif
-#ifdef CLOCK_HIGHRES
- PyModule_AddIntMacro(m, CLOCK_HIGHRES);
-#endif
-#ifdef CLOCK_PROCESS_CPUTIME_ID
- PyModule_AddIntMacro(m, CLOCK_PROCESS_CPUTIME_ID);
-#endif
-#ifdef CLOCK_THREAD_CPUTIME_ID
- PyModule_AddIntMacro(m, CLOCK_THREAD_CPUTIME_ID);
-#endif
-#endif /* HAVE_CLOCK_GETTIME */
}
@@ -1350,17 +1383,32 @@
/* Set, or reset, module variables like time.timezone */
PyInit_timezone(m);
+#if defined(HAVE_CLOCK_GETTIME)
+ PyModule_AddIntMacro(m, CLOCK_REALTIME);
+#ifdef CLOCK_MONOTONIC
+ PyModule_AddIntMacro(m, CLOCK_MONOTONIC);
+#endif
+#ifdef CLOCK_MONOTONIC_RAW
+ PyModule_AddIntMacro(m, CLOCK_MONOTONIC_RAW);
+#endif
+#ifdef CLOCK_HIGHRES
+ PyModule_AddIntMacro(m, CLOCK_HIGHRES);
+#endif
+#ifdef CLOCK_PROCESS_CPUTIME_ID
+ PyModule_AddIntMacro(m, CLOCK_PROCESS_CPUTIME_ID);
+#endif
+#ifdef CLOCK_THREAD_CPUTIME_ID
+ PyModule_AddIntMacro(m, CLOCK_THREAD_CPUTIME_ID);
+#endif
+#endif /* HAVE_CLOCK_GETTIME */
+
if (!initialized) {
if (PyStructSequence_InitType2(&StructTimeType,
&struct_time_type_desc) < 0)
return NULL;
}
Py_INCREF(&StructTimeType);
-#ifdef HAVE_STRUCT_TM_TM_ZONE
PyModule_AddIntConstant(m, "_STRUCT_TM_ITEMS", 11);
-#else
- PyModule_AddIntConstant(m, "_STRUCT_TM_ITEMS", 9);
-#endif
PyModule_AddObject(m, "struct_time", (PyObject*) &StructTimeType);
initialized = 1;
return m;
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c
--- a/Objects/rangeobject.c
+++ b/Objects/rangeobject.c
@@ -399,7 +399,7 @@
tmp2 = PyNumber_Remainder(tmp1, r->step);
if (tmp2 == NULL)
goto end;
- /* result = (int(ob) - start % step) == 0 */
+ /* result = ((int(ob) - start) % step) == 0 */
result = PyObject_RichCompareBool(tmp2, zero, Py_EQ);
end:
Py_XDECREF(tmp1);
diff --git a/Objects/setobject.c b/Objects/setobject.c
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -1476,6 +1476,10 @@
static int
set_difference_update_internal(PySetObject *so, PyObject *other)
{
+ if (PySet_GET_SIZE(so) == 0) {
+ return 0;
+ }
+
if ((PyObject *)so == other)
return set_clear_internal(so);
@@ -1550,6 +1554,10 @@
Py_ssize_t pos = 0;
int rv;
+ if (PySet_GET_SIZE(so) == 0) {
+ return set_copy(so);
+ }
+
if (!PyAnySet_Check(other) && !PyDict_CheckExact(other)) {
return set_copy_and_difference(so, other);
}
diff --git a/PCbuild/_lzma.vcxproj b/PCbuild/_lzma.vcxproj
--- a/PCbuild/_lzma.vcxproj
+++ b/PCbuild/_lzma.vcxproj
@@ -61,13 +61,11 @@
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
- <AdditionalIncludeDirectories>$(lzmaDir)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>$(lzmaDir)src/liblzma/api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;LZMA_API_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
- <AdditionalDependencies Condition="'$(Platform)' == 'Win32'">$(lzmaDir)\bin_i486\liblzma.a;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalDependencies Condition="'$(Platform)' == 'x64'">$(lzmaDir)\bin_x86-64\liblzma.a;%(AdditionalDependencies)</AdditionalDependencies>
- <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+ <AdditionalDependencies>$(OutDir)/liblzma$(PyDebugExt).lib</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
@@ -81,8 +79,12 @@
<Project>{cf7ac3d1-e2df-41d2-bea6-1e2556cdea26}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
+ <ProjectReference Include="liblzma.vcxproj">
+ <Project>{12728250-16eC-4dc6-94d7-e21dd88947f8}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat
--- a/PCbuild/get_externals.bat
+++ b/PCbuild/get_externals.bat
@@ -59,7 +59,7 @@
if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tcl-core-8.6.6.0
if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tk-8.6.6.0
if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tix-8.4.3.6
-set libraries=%libraries% xz-5.0.5
+set libraries=%libraries% xz-5.2.2
for %%e in (%libraries%) do (
if exist %%e (
diff --git a/PCbuild/liblzma.vcxproj b/PCbuild/liblzma.vcxproj
new file mode 100644
--- /dev/null
+++ b/PCbuild/liblzma.vcxproj
@@ -0,0 +1,216 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="PGInstrument|Win32">
+ <Configuration>PGInstrument</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="PGInstrument|x64">
+ <Configuration>PGInstrument</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="PGUpdate|Win32">
+ <Configuration>PGUpdate</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="PGUpdate|x64">
+ <Configuration>PGUpdate</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{12728250-16EC-4DC6-94D7-E21DD88947F8}</ProjectGuid>
+ <RootNamespace>liblzma</RootNamespace>
+ <SupportPGO>true</SupportPGO>
+ </PropertyGroup>
+
+ <Import Project="python.props" />
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+
+ <PropertyGroup Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="pyproject.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <ItemDefinitionGroup>
+ <ClCompile>
+ <PreprocessorDefinitions>WIN32;HAVE_CONFIG_H;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>$(lzmaDir)windows;$(lzmaDir)src/liblzma/common;$(lzmaDir)src/common;$(lzmaDir)src/liblzma/api;$(lzmaDir)src/liblzma/check;$(lzmaDir)src/liblzma/delta;$(lzmaDir)src/liblzma/lz;$(lzmaDir)src/liblzma/lzma;$(lzmaDir)src/liblzma/rangecoder;$(lzmaDir)src/liblzma/simple</AdditionalIncludeDirectories>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="$(lzmaDir)src\common\tuklib_cpucores.c" />
+ <ClCompile Include="$(lzmaDir)src\common\tuklib_physmem.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\check\check.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\check\crc32_fast.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\check\crc32_table.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\check\crc64_fast.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\check\crc64_table.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\check\sha256.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\alone_decoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\alone_encoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\auto_decoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\block_buffer_decoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\block_buffer_encoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\block_decoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\block_encoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\block_header_decoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\block_header_encoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\block_util.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\common.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\easy_buffer_encoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\easy_decoder_memusage.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\easy_encoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\easy_encoder_memusage.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\easy_preset.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\filter_buffer_decoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\filter_buffer_encoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\filter_common.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\filter_decoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\filter_encoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\filter_flags_decoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\filter_flags_encoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\hardware_cputhreads.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\hardware_physmem.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\index.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\index_decoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\index_encoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\index_hash.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\outqueue.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\stream_buffer_decoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\stream_buffer_encoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\stream_decoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\stream_encoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\stream_encoder_mt.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\stream_flags_common.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\stream_flags_decoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\stream_flags_encoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\vli_decoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\vli_encoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\common\vli_size.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\delta\delta_common.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\delta\delta_decoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\delta\delta_encoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\lzma\fastpos_table.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\lzma\lzma2_decoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\lzma\lzma2_encoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\lzma\lzma_decoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\lzma\lzma_encoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\lzma\lzma_encoder_optimum_fast.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\lzma\lzma_encoder_optimum_normal.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\lzma\lzma_encoder_presets.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\lz\lz_decoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\lz\lz_encoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\lz\lz_encoder_mf.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\rangecoder\price_table.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\simple\arm.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\simple\armthumb.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\simple\ia64.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\simple\powerpc.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\simple\simple_coder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\simple\simple_decoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\simple\simple_encoder.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\simple\sparc.c" />
+ <ClCompile Include="$(lzmaDir)src\liblzma\simple\x86.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="$(lzmaDir)src\common\mythread.h" />
+ <ClInclude Include="$(lzmaDir)src\common\sysdefs.h" />
+ <ClInclude Include="$(lzmaDir)src\common\tuklib_common.h" />
+ <ClInclude Include="$(lzmaDir)src\common\tuklib_config.h" />
+ <ClInclude Include="$(lzmaDir)src\common\tuklib_cpucores.h" />
+ <ClInclude Include="$(lzmaDir)src\common\tuklib_integer.h" />
+ <ClInclude Include="$(lzmaDir)src\common\tuklib_physmem.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\api\lzma.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\api\lzma\base.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\api\lzma\bcj.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\api\lzma\block.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\api\lzma\check.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\api\lzma\container.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\api\lzma\delta.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\api\lzma\filter.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\api\lzma\hardware.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\api\lzma\index.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\api\lzma\index_hash.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\api\lzma\lzma12.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\api\lzma\stream_flags.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\api\lzma\version.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\api\lzma\vli.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\check\check.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\check\crc32_table_be.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\check\crc32_table_le.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\check\crc64_table_be.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\check\crc64_table_le.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\check\crc_macros.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\common\alone_decoder.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\common\block_buffer_encoder.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\common\block_decoder.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\common\block_encoder.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\common\common.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\common\easy_preset.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\common\filter_common.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\common\filter_decoder.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\common\filter_encoder.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\common\index.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\common\index_encoder.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\common\memcmplen.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\common\outqueue.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\common\stream_decoder.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\common\stream_flags_common.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\delta\delta_common.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\delta\delta_decoder.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\delta\delta_encoder.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\delta\delta_private.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\lzma\fastpos.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\lzma\lzma2_decoder.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\lzma\lzma2_encoder.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\lzma\lzma_common.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\lzma\lzma_decoder.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\lzma\lzma_encoder.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\lzma\lzma_encoder_private.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\lz\lz_decoder.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\lz\lz_encoder.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\lz\lz_encoder_hash.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\lz\lz_encoder_hash_table.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\rangecoder\price.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\rangecoder\range_common.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\rangecoder\range_decoder.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\rangecoder\range_encoder.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\simple\simple_coder.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\simple\simple_decoder.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\simple\simple_encoder.h" />
+ <ClInclude Include="$(lzmaDir)src\liblzma\simple\simple_private.h" />
+ <ClInclude Include="$(lzmaDir)windows\config.h" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props
--- a/PCbuild/pyproject.props
+++ b/PCbuild/pyproject.props
@@ -7,7 +7,6 @@
<OutDir Condition="!HasTrailingSlash($(OutDir))">$(OutDir)\</OutDir>
<Py_IntDir Condition="'$(Py_IntDir)' == ''">$(MSBuildThisFileDirectory)obj\</Py_IntDir>
<IntDir>$(Py_IntDir)\$(ArchName)_$(Configuration)\$(ProjectName)\</IntDir>
- <IntDir Condition="$(Configuration) == 'PGInstrument' or $(Configuration) == 'PGUpdate'">$(Py_IntDir)\$(ArchName)_PGO\$(ProjectName)\</IntDir>
<TargetName Condition="'$(TargetName)' == ''">$(ProjectName)</TargetName>
<TargetName>$(TargetName)$(PyDebugExt)</TargetName>
<GenerateManifest>false</GenerateManifest>
diff --git a/PCbuild/python.props b/PCbuild/python.props
--- a/PCbuild/python.props
+++ b/PCbuild/python.props
@@ -25,7 +25,6 @@
-->
<ArchName Condition="'$(ArchName)' == '' and $(Platform) == 'x64'">amd64</ArchName>
<ArchName Condition="'$(ArchName)' == ''">win32</ArchName>
- <ArchName Condition="$(Configuration) == 'PGInstrument' or $(Configuration) == 'PGUpdate'">$(ArchName)-pgo</ArchName>
<!-- Root directory of the repository -->
<PySourcePath Condition="'$(PySourcePath)' == ''">$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)\..\))</PySourcePath>
@@ -45,7 +44,7 @@
<ExternalsDir>$([System.IO.Path]::GetFullPath(`$(PySourcePath)externals\`))</ExternalsDir>
<sqlite3Dir>$(ExternalsDir)sqlite-3.14.1.0\</sqlite3Dir>
<bz2Dir>$(ExternalsDir)bzip2-1.0.6\</bz2Dir>
- <lzmaDir>$(ExternalsDir)xz-5.0.5\</lzmaDir>
+ <lzmaDir>$(ExternalsDir)xz-5.2.2\</lzmaDir>
<opensslDir>$(ExternalsDir)openssl-1.0.2h\</opensslDir>
<opensslIncludeDir>$(opensslDir)include32</opensslIncludeDir>
<opensslIncludeDir Condition="'$(ArchName)' == 'amd64'">$(opensslDir)include64</opensslIncludeDir>
diff --git a/Tools/msi/buildrelease.bat b/Tools/msi/buildrelease.bat
--- a/Tools/msi/buildrelease.bat
+++ b/Tools/msi/buildrelease.bat
@@ -111,16 +111,10 @@
set BUILD_PLAT=Win32
set OUTDIR_PLAT=win32
set OBJDIR_PLAT=x86
-) else if "%~2" NEQ "" (
- call "%PCBUILD%env.bat" amd64
- set PGO=%~2
- set BUILD=%PCBUILD%amd64-pgo\
- set BUILD_PLAT=x64
- set OUTDIR_PLAT=amd64
- set OBJDIR_PLAT=x64
) else (
call "%PCBUILD%env.bat" amd64
set BUILD=%PCBUILD%amd64\
+ set PGO=%~2
set BUILD_PLAT=x64
set OUTDIR_PLAT=amd64
set OBJDIR_PLAT=x64
@@ -177,7 +171,6 @@
)
set BUILDOPTS=/p:Platform=%1 /p:BuildForRelease=true /p:DownloadUrl=%DOWNLOAD_URL% /p:DownloadUrlBase=%DOWNLOAD_URL_BASE% /p:ReleaseUri=%RELEASE_URI%
-if "%PGO%" NEQ "" set BUILDOPTS=%BUILDOPTS% /p:PGOBuildPath=%BUILD%
msbuild "%D%bundle\releaselocal.wixproj" /t:Rebuild %BUILDOPTS% %CERTOPTS% /p:RebuildAll=true
if errorlevel 1 exit /B
msbuild "%D%bundle\releaseweb.wixproj" /t:Rebuild %BUILDOPTS% %CERTOPTS% /p:RebuildAll=false
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -2679,7 +2679,7 @@
-if test "$abs_srcdir" != "$abs_builddir"; then
+if test "$srcdir" != . -a "$srcdir" != "$(pwd)"; then
# If we're building out-of-tree, we need to make sure the following
# resources get picked up before their $srcdir counterparts.
# Objects/ -> typeslots.inc
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -10,7 +10,7 @@
AC_INIT(python, PYTHON_VERSION, https://bugs.python.org/)
AC_SUBST(BASECPPFLAGS)
-if test "$abs_srcdir" != "$abs_builddir"; then
+if test "$srcdir" != . -a "$srcdir" != "$(pwd)"; then
# If we're building out-of-tree, we need to make sure the following
# resources get picked up before their $srcdir counterparts.
# Objects/ -> typeslots.inc
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list