Commit Graph

97699 Commits

Author SHA1 Message Date
Serhiy Storchaka
fb3134f4d4 Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions. 2016-12-06 00:20:26 +02:00
Serhiy Storchaka
9a953dbb34 Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions. 2016-12-06 00:17:45 +02:00
Serhiy Storchaka
419967b832 Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions. 2016-12-06 00:13:34 +02:00
Victor Stinner
9083eb6aac Use directly _PyObject_GenericSetAttrWithDict()
Modify type_setattro() to call directly _PyObject_GenericSetAttrWithDict()
instead of PyObject_GenericSetAttr().

PyObject_GenericSetAttr() is a thin wrapper to
_PyObject_GenericSetAttrWithDict().
2016-12-05 18:23:27 +01:00
Victor Stinner
408bfa6d96 Issue #28152: Fix -Wunreachable-code warning on clang
Replace 0 with (0) to ignore a compiler warning about dead code on
"((int)(SEM_VALUE_MAX) < 0)": SEM_VALUE_MAX is not negative on Linux.
2016-12-05 18:00:42 +01:00
Victor Stinner
44d9bea1b8 Issue #28152: Fix -Wunreachable-code warning on clang
Replace C if() with precompiler #if to fix a warning on dead code when using
clang.
2016-12-05 17:55:36 +01:00
Victor Stinner
9a2329f9e1 Issue #28152: Fix -Wunreachable-code warnings on Clang
Don't declare dead code when the code is declared with Clang.
2016-12-05 17:56:36 +01:00
Victor Stinner
7bfb42d5b7 Issue #28858: Remove _PyObject_CallArg1() macro
Replace
   _PyObject_CallArg1(func, arg)
with
   PyObject_CallFunctionObjArgs(func, arg, NULL)

Using the _PyObject_CallArg1() macro increases the usage of the C stack, which
was unexpected and unwanted. PyObject_CallFunctionObjArgs() doesn't have this
issue.
2016-12-05 17:04:32 +01:00
Nick Coghlan
d77e5b7211 Merge #23722 from 3.6 2016-12-05 16:59:22 +10:00
Nick Coghlan
19d246745d Issue #23722: improve __classcell__ compatibility
Handling zero-argument super() in __init_subclass__ and
__set_name__ involved moving __class__ initialisation to
type.__new__. This requires cooperation from custom
metaclasses to ensure that the new __classcell__ entry
is passed along appropriately.

The initial implementation of that change resulted in abruptly
broken zero-argument super() support in metaclasses that didn't
adhere to the new requirements (such as Django's metaclass for
Model definitions).

The updated approach adopted here instead emits a deprecation
warning for those cases, and makes them work the same way they
did in Python 3.5.

This patch also improves the related class machinery documentation
to cover these details and to include more reader-friendly
cross-references and index entries.
2016-12-05 16:47:55 +10:00
Victor Stinner
de4ae3d486 Backed out changeset b9c9691c72c5
Issue #28858: The change b9c9691c72c5 introduced a regression. It seems like
_PyObject_CallArg1() uses more stack memory than
PyObject_CallFunctionObjArgs().
2016-12-04 22:59:09 +01:00
Raymond Hettinger
c8d03187ff merge 2016-12-04 11:00:57 -08:00
Raymond Hettinger
71c62e14aa Neaten-up and extend the examples in the random module docs. 2016-12-04 11:00:34 -08:00
Serhiy Storchaka
8209cec0bd Fixed mismatching title overline. 2016-12-04 15:43:57 +02:00
Serhiy Storchaka
223813111e Fixed mismatching title overline. 2016-12-04 15:43:37 +02:00
Serhiy Storchaka
7bc01c32b1 Fixed mismatching title overline. 2016-12-04 15:42:13 +02:00
Serhiy Storchaka
a8037db69d Fixed double hyphens that are rendered to literal en-dashes in the documenation. 2016-12-04 10:22:36 +02:00
Serhiy Storchaka
e418432dfb Fixed double hyphens that are rendered to literal en-dashes in the documenation. 2016-12-04 10:22:09 +02:00
Serhiy Storchaka
29b0a26822 Fixed double hyphens that are rendered to literal en-dashes in the documenation. 2016-12-04 10:20:55 +02:00
Steve Dower
ed04388328 Null merge with 3.6 2016-12-03 15:57:15 -08:00
Steve Dower
21cf577526 Revert unintended merge 2016-12-03 15:57:00 -08:00
Steve Dower
01a057aff4 Revert unintended merge 2016-12-03 12:12:23 -08:00
Steve Dower
9cc113a8f7 Issue #28846: Various installer fixes 2016-12-03 12:11:25 -08:00
Steve Dower
f00ef72ee1 Ensures intermediate directory is created before using it 2016-12-03 11:56:44 -08:00
Steve Dower
de6efdb772 Ensures intermediate directory is created before accessing it. 2016-12-03 11:56:20 -08:00
Steve Dower
1058109b31 Issue #28846: Various installer fixes 2016-12-03 11:24:02 -08:00
Steve Dower
190dbd9ba2 Issue #28846: Various installer fixes 2016-12-03 11:18:53 -08:00
Serhiy Storchaka
2d397dc44b Merge heads 2016-12-02 23:34:24 +02:00
Serhiy Storchaka
853ec5d408 Issue #21818: Fixed references to classes that have names matching with module
names.
2016-12-02 23:15:42 +02:00
Serhiy Storchaka
b6a6b45458 Issue #21818: Fixed references to classes that have names matching with module
names.
2016-12-02 23:15:22 +02:00
Serhiy Storchaka
ee1b01a41b Issue #21818: Fixed references to classes that have names matching with module
names.
2016-12-02 23:13:53 +02:00
Serhiy Storchaka
4700d86488 Merge from 3.6. 2016-12-02 21:38:46 +02:00
Serhiy Storchaka
b93626404c Null merge 2016-12-02 21:33:05 +02:00
Nick Coghlan
3c35fdb8fb Issue #27172: Undeprecate inspect.getfullargspec()
This is still useful for single source Python 2/3 code
migrating away from inspect.getargspec(), but that wasn't
clear with the documented deprecation in place.
2016-12-02 20:29:57 +10:00
Benjamin Peterson
7cf9e13f25 fix _PyObject_CallArg1 compiler warnings (closes #28855) 2016-12-01 22:01:32 -08:00
Victor Stinner
d6958ac6c0 Add sys.getandroidapilevel()
Issue #28740: Add sys.getandroidapilevel(): return the build time
API version of Android as an integer.

Function only available on Android.
2016-12-02 01:13:46 +01:00
doko@ubuntu.com
1177696b6b - Import latest config.sub config.guess files 2016-12-01 21:42:56 +01:00
Yury Selivanov
edfe8869c8 Merge 3.6 (issue #28843) 2016-12-01 11:37:47 -05:00
Yury Selivanov
c2c8fe1252 Issue #28843: Fix asyncio C Task to handle exceptions __traceback__. 2016-12-01 11:36:22 -05:00
Victor Stinner
4778eab1f2 Replace PyObject_CallFunction() with fastcall
Replace
    PyObject_CallFunction(func, "O", arg)
and
    PyObject_CallFunction(func, "O", arg, NULL)
with
    _PyObject_CallArg1(func, arg)

Replace
    PyObject_CallFunction(func, NULL)
with
    _PyObject_CallNoArg(func)

_PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate
memory on the C stack.
2016-12-01 14:51:04 +01:00
Victor Stinner
842cfff321 WITH_CLEANUP_START uses fastcall
Modify WITH_CLEANUP_START bytecode: replace PyObject_CallFunctionObjArgs() with
_PyObject_FastCall().
2016-12-01 14:45:31 +01:00
Victor Stinner
27580c1fb5 Replace PyObject_CallFunctionObjArgs() with fastcall
* PyObject_CallFunctionObjArgs(func, NULL) => _PyObject_CallNoArg(func)
* PyObject_CallFunctionObjArgs(func, arg, NULL) => _PyObject_CallArg1(func, arg)

PyObject_CallFunctionObjArgs() allocates 40 bytes on the C stack and requires
extra work to "parse" C arguments to build a C array of PyObject*.

_PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate
memory on the C stack.

This change is part of the fastcall project. The change on listsort() is
related to the issue #23507.
2016-12-01 14:43:22 +01:00
Victor Stinner
8be1c39eb3 Backed out changeset 7efddbf1aa70 2016-11-30 12:10:54 +01:00
Victor Stinner
ebea9988e0 Uniformize argument names of "call" functions
* Callable object: callable, o, callable_object => func
* Object for method calls: o => obj
* Method name: name or nameid => method

Cleanup also the C code:

* Don't initialize variables to NULL if they are not used before their first
  assignement
* Add braces for readability
2016-11-29 18:47:56 +01:00
Guido van Rossum
356ae170ef Issue #28790: Fix error when using Generic and __slots__ (Ivan L) (3.6->3.7) 2016-11-29 09:46:29 -08:00
Guido van Rossum
c349374ee6 Issue #28790: Fix error when using Generic and __slots__ (Ivan L) (3.5->3.6) 2016-11-29 09:46:26 -08:00
Guido van Rossum
61f0a0261f Issue #28790: Fix error when using Generic and __slots__ (Ivan L) 2016-11-29 09:46:21 -08:00
Victor Stinner
f9c2405ff8 Null merge 3.6 2016-11-29 18:22:02 +01:00
Victor Stinner
11dd6048aa Add TCP_CONGESTION and TCP_USER_TIMEOUT
Issue #26273: Add new socket.TCP_CONGESTION (Linux 2.6.13) and
socket.TCP_USER_TIMEOUT (Linux 2.6.37) constants.

Patch written by Omar Sandoval.
2016-11-29 16:55:04 +01:00
Victor Stinner
4f8dc3d15c Add TCP_CONGESTION and TCP_USER_TIMEOUT
Issue #26273: Add new socket.TCP_CONGESTION (Linux 2.6.13) and
socket.TCP_USER_TIMEOUT (Linux 2.6.37) constants.

Patch written by Omar Sandoval.
2016-11-29 16:55:04 +01:00