Subject | Hash | Author | Date (UTC) |
---|---|---|---|
bpo-29849: fix a memory leak in import_from (GH-712) | 4830f581af57dd305c02c1fd72299ecb5b090eca | Xiang Zhang | 2017-03-21 03:13:42 |
Fix "NotImplentedError" typo in constants documentation (#692) | 05f53735c8912f8df1077e897f052571e13c3496 | zertrin | 2017-03-20 12:24:39 |
bpo-20087: Revert "make the glibc alias table take precedence over the X11 one (#422)" (#713) | df8280838f52d6ec45ba03ef734b0dec8a9c43fb | Benjamin Peterson | 2017-03-20 06:49:43 |
bpo-28876: bool of large range raises OverflowError (#699) | e46fb8611867fa3b407a813f53137929b7cb4a10 | 4kir4 | 2017-03-20 06:44:46 |
bpo-29856: Fix typo in curses documentation (GH-730) | 64508780d72769e4c7afc67a511c057261c578f6 | Mariatta | 2017-03-20 03:48:04 |
bpo-29845: Mark tests that use _testcapi as CPython-only (#711) | 24c738a9e91b8f46da6166663d8ce7ec18cec784 | Serhiy Storchaka | 2017-03-19 18:20:10 |
bpo-29116: Fix error messages for concatenating bytes and bytearray with unsupported type. (#709) | 6b5a9ec4788770c652bac3bf5d5a0a3b710b82ae | Serhiy Storchaka | 2017-03-19 17:47:02 |
bpo-29116: Improve error message for concatenating str with non-str. (#710) | 004e03fb0c2febe2ec8afbd28ffcb3e980c63228 | Serhiy Storchaka | 2017-03-19 17:38:42 |
bpo-29748: Added the slice index converter in Argument Clinic. (#549) | 80ec8364f15857c405ef0ecb1e758c8fc6b332f7 | Serhiy Storchaka | 2017-03-19 17:37:40 |
bpo-25455: Fixed crashes in repr of recursive buffered file-like objects. (#514) | a5af6e1af77ee0f9294c5776478a9c24d9fbab94 | Serhiy Storchaka | 2017-03-19 17:25:29 |
Drop C++ header compatibility test (#718) | 77ed11552da3e01dd235b7d68988076866b1f604 | Brett Cannon | 2017-03-19 16:49:55 |
bpo-29793: Convert some builtin types constructors to Argument Clinic. (#615) | 18b250f844bf8b2d1a81c2d2dcc74e850364fe35 | Serhiy Storchaka | 2017-03-19 06:51:07 |
bpo-20186: Convert tuple object implementation to Argument Clinic. (#614) | 0b5615926a573c19c887a701a2f7047f4fd06de6 | Serhiy Storchaka | 2017-03-19 06:47:58 |
bpo-20185: Convert typeobject.c to Argument Clinic. (#544) | 5c643a028ee86c613d7168ca5bcb8fc94477a09e | Serhiy Storchaka | 2017-03-19 06:46:44 |
bpo-29776: Use decorator syntax for properties. (#585) | bdf6b910f9ea75609caee498a975af03b6d23f67 | Serhiy Storchaka | 2017-03-19 06:40:32 |
bpo-28749: Fixed the documentation of the mapping codec APIs. (#487) | c85a26628ceb9624c96c3064e8b99033c026d8a3 | Serhiy Storchaka | 2017-03-19 06:15:17 |
bpo-27200: Fix doctests in programming.rst and datetime.rst (#401) | 909a6f626ff343937cd3f06fda996870e7890724 | Marco Buttu | 2017-03-18 16:59:33 |
Combine the C++ header CI build into the main C build (GH-697) | 993d4b3440f2282976901ce66879037c4443868a | Brett Cannon | 2017-03-17 22:29:27 |
bpo-29836: Remove nturl2path from test_sundry and amend the module docstring (GH-694) | cb5297a9e6b51c736ab8564b1a123577ba0dd2ad | Jim Fasarakis-Hilliard | 2017-03-17 18:16:20 |
bpo-29808: SysLogHandler: Do not fail if initial connect to syslog failed (#663) (#663) | 1b038e073807ecb6fd176edaf3386a8e3205416e | Коренберг Марк | 2017-03-17 15:25:05 |
File | Lines added | Lines deleted |
---|---|---|
Misc/NEWS | 2 | 0 |
Python/ceval.c | 17 | 10 |
File Misc/NEWS changed (mode: 100644) (index d8ea4c91e5..b86e5c96f2) | |||
... | ... | What's New in Python 3.7.0 alpha 1? | |
10 | 10 | Core and Builtins | Core and Builtins |
11 | 11 | ----------------- | ----------------- |
12 | 12 | ||
13 | - bpo-29849: Fix a memory leak when an ImportError is raised during from import. | ||
14 | |||
13 | 15 | - bpo-28856: Fix an oversight that %b format for bytes should support objects | - bpo-28856: Fix an oversight that %b format for bytes should support objects |
14 | 16 | follow the buffer protocol. | follow the buffer protocol. |
15 | 17 |
File Python/ceval.c changed (mode: 100644) (index 8ee58f5d30..fd60b7344a) | |||
... | ... | import_from(PyObject *v, PyObject *name) | |
5024 | 5024 | { | { |
5025 | 5025 | PyObject *x; | PyObject *x; |
5026 | 5026 | _Py_IDENTIFIER(__name__); | _Py_IDENTIFIER(__name__); |
5027 | PyObject *fullmodname, *pkgname, *pkgpath, *pkgname_or_unknown; | ||
5027 | PyObject *fullmodname, *pkgname, *pkgpath, *pkgname_or_unknown, *errmsg; | ||
5028 | 5028 | ||
5029 | 5029 | x = PyObject_GetAttr(v, name); | x = PyObject_GetAttr(v, name); |
5030 | 5030 | if (x != NULL || !PyErr_ExceptionMatches(PyExc_AttributeError)) | if (x != NULL || !PyErr_ExceptionMatches(PyExc_AttributeError)) |
... | ... | import_from(PyObject *v, PyObject *name) | |
5039 | 5039 | } | } |
5040 | 5040 | fullmodname = PyUnicode_FromFormat("%U.%U", pkgname, name); | fullmodname = PyUnicode_FromFormat("%U.%U", pkgname, name); |
5041 | 5041 | if (fullmodname == NULL) { | if (fullmodname == NULL) { |
5042 | Py_DECREF(pkgname); | ||
5042 | 5043 | return NULL; | return NULL; |
5043 | 5044 | } | } |
5044 | 5045 | x = PyDict_GetItem(PyImport_GetModuleDict(), fullmodname); | x = PyDict_GetItem(PyImport_GetModuleDict(), fullmodname); |
... | ... | import_from(PyObject *v, PyObject *name) | |
5063 | 5064 | ||
5064 | 5065 | if (pkgpath == NULL || !PyUnicode_Check(pkgpath)) { | if (pkgpath == NULL || !PyUnicode_Check(pkgpath)) { |
5065 | 5066 | PyErr_Clear(); | PyErr_Clear(); |
5066 | PyErr_SetImportError( | ||
5067 | PyUnicode_FromFormat("cannot import name %R from %R (unknown location)", | ||
5068 | name, pkgname_or_unknown), | ||
5069 | pkgname, NULL); | ||
5070 | } else { | ||
5071 | PyErr_SetImportError( | ||
5072 | PyUnicode_FromFormat("cannot import name %R from %R (%S)", | ||
5073 | name, pkgname_or_unknown, pkgpath), | ||
5074 | pkgname, pkgpath); | ||
5067 | errmsg = PyUnicode_FromFormat( | ||
5068 | "cannot import name %R from %R (unknown location)", | ||
5069 | name, pkgname_or_unknown | ||
5070 | ); | ||
5071 | /* NULL check for errmsg done by PyErr_SetImportError. */ | ||
5072 | PyErr_SetImportError(errmsg, pkgname, NULL); | ||
5073 | } | ||
5074 | else { | ||
5075 | errmsg = PyUnicode_FromFormat( | ||
5076 | "cannot import name %R from %R (%S)", | ||
5077 | name, pkgname_or_unknown, pkgpath | ||
5078 | ); | ||
5079 | /* NULL check for errmsg done by PyErr_SetImportError. */ | ||
5080 | PyErr_SetImportError(errmsg, pkgname, pkgpath); | ||
5075 | 5081 | } | } |
5076 | 5082 | ||
5083 | Py_XDECREF(errmsg); | ||
5077 | 5084 | Py_XDECREF(pkgname_or_unknown); | Py_XDECREF(pkgname_or_unknown); |
5078 | 5085 | Py_XDECREF(pkgpath); | Py_XDECREF(pkgpath); |
5079 | 5086 | return NULL; | return NULL; |