summaryrefslogtreecommitdiffstats
path: root/Modules/_tkinter.c
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-106350: Tkinter: do not ignore return value of `mp_init()` ↵Miss Islington (bot)2023-07-261-2/+3
| | | | | | | (GH-106351) (GH-107258) (cherry picked from commit b5ae7c498438657a6ba0bf4cc216b9c2c93a06c7) Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
* [3.12] gh-104399: Use newer libtommath APIs when necessary (GH-104407) (#105343)Miss Islington (bot)2023-06-061-2/+21
| | | | | | gh-104399: Use newer libtommath APIs when necessary (GH-104407) (cherry picked from commit 00d73caf804c0474980e471347d6385757af975f) Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
* gh-103839: Allow building Tkinter against Tcl 8.7 without external ↵Christopher Chavez2023-05-191-0/+3
| | | | libtommath (GH-103842)
* gh-103538: Remove unused TK_AQUA code (GH-103539)Christopher Chavez2023-05-101-14/+0
|
* gh-103532: Remove TKINTER_PROTECT_LOADTK code (GH-103535)Christopher Chavez2023-04-141-47/+0
| | | | This was only needed for Tk 8.4.13 and older, but Tkinter already requires at least 8.5.12.
* gh-103167: Fix `-Wstrict-prototypes` warnings by using `(void)` for ↵Nikita Sobolev2023-04-051-1/+1
| | | | functions with no args (GH-103168)
* GH-101291: Rearrange the size bits in PyLongObject (GH-102464)Mark Shannon2023-03-221-2/+5
| | | | | | | | | | * Eliminate all remaining uses of Py_SIZE and Py_SET_SIZE on PyLongObject, adding asserts. * Change layout of size/sign bits in longobject to support future addition of immortal ints and tagged medium ints. * Add functions to hide some internals of long object, and for setting sign and digit count. * Replace uses of IS_MEDIUM_VALUE macro with _PyLong_IsCompact().
* gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives in ↵Irit Katriel2023-03-011-34/+24
| | | | tkinter module (#102319)
* bpo-15999: Accept arbitrary values for boolean parameters. (#15609)Serhiy Storchaka2022-12-031-6/+6
| | | builtins and extension module functions and methods that expect boolean values for parameters now accept any Python object rather than just a bool or int type. This is more consistent with how native Python code itself behaves.
* gh-99537: Use Py_SETREF(var, NULL) in C code (#99687)Victor Stinner2022-11-231-2/+1
| | | Replace "Py_DECREF(var); var = NULL;" with "Py_SETREF(var, NULL);".
* gh-99537: Use Py_SETREF() function in C code (#99656)Victor Stinner2022-11-221-2/+1
| | | | | | | | | | | | | | | Fix potential race condition in code patterns: * Replace "Py_DECREF(var); var = new;" with "Py_SETREF(var, new);" * Replace "Py_XDECREF(var); var = new;" with "Py_XSETREF(var, new);" * Replace "Py_CLEAR(var); var = new;" with "Py_XSETREF(var, new);" Other changes: * Replace "old = var; var = new; Py_DECREF(var)" with "Py_SETREF(var, new);" * Replace "old = var; var = new; Py_XDECREF(var)" with "Py_XSETREF(var, new);" * And remove the "old" variable.
* gh-99300: Use Py_NewRef() in Modules/ directory (#99468)Victor Stinner2022-11-141-32/+16
| | | | Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in test C files of the Modules/ directory.
* bpo-46996: Remove support of Tcl/Tk < 8.5.12 (GH-31839)Serhiy Storchaka2022-03-171-24/+4
|
* bpo-46920: Remove code that has explainers why it was disabled (GH-31813)Oleg Iarygin2022-03-141-6/+0
|
* bpo-46670: Remove unused macros in the Modules directory (GH-31194)Victor Stinner2022-02-071-4/+0
| | | | | * bpo-46670: Remove unused macros in the Modules directory * Add again LINKAT_DIR_FD_CONVERTER: generated by Argument Clinic
* bpo-46303: Fix fileutils.h compiler warnings (GH-30550)Victor Stinner2022-01-111-0/+6
| | | | Add missing pycore_fileutils.h include in _tkinter.c and _testconsole.c.
* Fix typos in the Modules directory (GH-28761)Christian Clauss2021-10-071-1/+1
|
* bpo-38371: Remove deprecated `tkinter` split() method (GH-28237)Erlend Egeberg Aasland2021-09-081-202/+0
|
* bpo-44608: Fix memory leak in _tkinter._flatten() (GH-27107)Serhiy Storchaka2021-07-141-1/+3
| | | | if it is called with a sequence or set, but not list or tuple.
* Fix compiler warning for misleading guarding in the tkinter (GH-26244)Pablo Galindo2021-05-191-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | The newest gcc emmits this warning: ``` /Modules/_tkinter.c:272:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 272 | if(tcl_lock)PyThread_acquire_lock(tcl_lock, 1); tcl_tstate = tstate; } | ^~ /Modules/_tkinter.c:2869:5: note: in expansion of macro ‘LEAVE_PYTHON’ 2869 | LEAVE_PYTHON | ^~~~~~~~~~~~ /Modules/_tkinter.c:243:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 243 | (*(PyThreadState**)Tcl_GetThreadData(&state_key, sizeof(PyThreadState*))) | ^ /Modules/_tkinter.c:272:57: note: in expansion of macro ‘tcl_tstate’ 272 | if(tcl_lock)PyThread_acquire_lock(tcl_lock, 1); tcl_tstate = tstate; } | ^~~~~~~~~~ /Modules/_tkinter.c:2869:5: note: in expansion of macro ‘LEAVE_PYTHON’ 2869 | LEAVE_PYTHON ``` that's because the macro packs together two statements at the same level as the "if". The warning is misleading but is very noisy so it makes sense to fix it.
* bpo-43916: Add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag (GH-25721)Victor Stinner2021-04-301-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new Py_TPFLAGS_DISALLOW_INSTANTIATION type flag to disallow creating type instances: set tp_new to NULL and don't create the "__new__" key in the type dictionary. The flag is set automatically on static types if tp_base is NULL or &PyBaseObject_Type and tp_new is NULL. Use the flag on the following types: * _curses.ncurses_version type * _curses_panel.panel * _tkinter.Tcl_Obj * _tkinter.tkapp * _tkinter.tktimertoken * _xxsubinterpretersmodule.ChannelID * sys.flags type * sys.getwindowsversion() type * sys.version_info type Update MyStr example in the C API documentation to use Py_TPFLAGS_DISALLOW_INSTANTIATION. Add _PyStructSequence_InitType() function to create a structseq type with the Py_TPFLAGS_DISALLOW_INSTANTIATION flag set. type_new() calls _PyType_CheckConsistency() at exit.
* bpo-42519: Replace PyObject_MALLOC() with PyObject_Malloc() (GH-23587)Victor Stinner2020-12-011-3/+3
| | | | | | | | | No longer use deprecated aliases to functions: * Replace PyObject_MALLOC() with PyObject_Malloc() * Replace PyObject_REALLOC() with PyObject_Realloc() * Replace PyObject_FREE() with PyObject_Free() * Replace PyObject_Del() with PyObject_Free() * Replace PyObject_DEL() with PyObject_Free()
* bpo-42519: Replace PyMem_MALLOC() with PyMem_Malloc() (GH-23586)Victor Stinner2020-12-011-4/+4
| | | | | | | | | | | No longer use deprecated aliases to functions: * Replace PyMem_MALLOC() with PyMem_Malloc() * Replace PyMem_REALLOC() with PyMem_Realloc() * Replace PyMem_FREE() with PyMem_Free() * Replace PyMem_Del() with PyMem_Free() * Replace PyMem_DEL() with PyMem_Free() Modify also the PyMem_DEL() macro to use directly PyMem_Free().
* bpo-42318: Fix support of non-BMP characters in Tkinter on macOS (GH-23281)Serhiy Storchaka2020-11-151-1/+53
|
* Trivial typo fix in _tkinter.c (GH-19622)Andrew York2020-05-151-7/+7
| | | Change spelling of a #define in _tkinter.c from HAVE_LIBTOMMAMTH to HAVE_LIBTOMMATH, since this is used to keep track of tclTomMath.h, not tclTomMamth.h. No other file seems to refer to this variable.
* bpo-40268: Remove explicit pythread.h includes (#19529)Victor Stinner2020-04-151-2/+0
| | | | Remove explicit pythread.h includes: it is always included by Python.h.
* bpo-39943: Add the const qualifier to pointers on non-mutable PyBytes data. ↵Serhiy Storchaka2020-04-121-2/+2
| | | | (GH-19472)
* bpo-39573: Clean up modules and headers to use Py_IS_TYPE() function (GH-18521)Dong-hee Na2020-02-171-1/+1
|
* bpo-39573: Use Py_TYPE() macro in Modules directory (GH-18393)Victor Stinner2020-02-071-2/+2
| | | Replace direct access to PyObject.ob_type with Py_TYPE().
* bpo-38835: Don't use PyFPE_START_PROTECT and PyFPE_END_PROTECT (GH-17231)Victor Stinner2019-11-201-2/+0
| | | | | The PyFPE_START_PROTECT() and PyFPE_END_PROTECT() macros are empty: they have been doing nothing for the last year (since commit 735ae8d139a673b30b321dc10acfd3d14f0d633b), so stop using them.
* bpo-38823: Clean up refleaks in _tkinter initialization. (GH-17206)Brandt Bucher2019-11-181-0/+2
| | | https://bugs.python.org/issue38823
* bpo-38371: Tkinter: deprecate the split() method. (GH-16584)Serhiy Storchaka2019-10-081-0/+6
|
* bpo-13153: Use OS native encoding for converting between Python and Tcl. ↵Serhiy Storchaka2019-10-041-173/+202
| | | | | | | | | | | | | (GH-16545) On Windows use UTF-16 (or UTF-32 for 32-bit Tcl_UniChar) with the "surrogatepass" error handler for converting to/from Tcl Unicode objects. On Linux use UTF-8 with the "surrogateescape" error handler for converting to/from Tcl String objects. Converting strings from Tcl to Python and back now never fails (except MemoryError).
* bpo-37206: Unrepresentable default values no longer represented as None. ↵Serhiy Storchaka2019-09-141-4/+4
| | | | | | | (GH-13933) In ArgumentClinic, value "NULL" should now be used only for unrepresentable default values (like in the optional third parameter of getattr). "None" should be used if None is accepted as argument and passing None has the same effect as not passing the argument at all.
* bpo-37752: Delete redundant Py_CHARMASK in normalizestring() (GH-15095)Jordon Xu2019-09-101-2/+2
|
* bpo-37194: Add a new public PyObject_CallNoArgs() function (GH-13890)Victor Stinner2019-06-171-1/+1
| | | | | | | | | | | | | | | Add a new public PyObject_CallNoArgs() function to the C API: call a callable Python object without any arguments. It is the most efficient way to call a callback without any argument. On x86-64, for example, PyObject_CallFunctionObjArgs(func, NULL) allocates 960 bytes on the stack per call, whereas PyObject_CallNoArgs(func) only allocates 624 bytes per call. It is excluded from stable ABI 3.8. Replace private _PyObject_CallNoArg() with public PyObject_CallNoArgs() in C extensions: _asyncio, _datetime, _elementtree, _pickle, _tkinter and readline.
* bpo-35810: Incref heap-allocated types in PyObject_Init (GH-11661)Eddie Elizondo2019-03-271-3/+0
| | | | | * Incref heap-allocated types in PyObject_Init * Add documentation and porting notes to What's New
* bpo-33029: Fix signatures of getter and setter functions. (GH-10746)Serhiy Storchaka2018-11-271-2/+2
| | | Fix also return type for few other functions (clear, releasebuffer).
* bpo-34794: Fix a leak in Tkinter. (GH-10025)Serhiy Storchaka2018-10-231-3/+1
| | | Based on the investigation by Xiang Zhang.
* Fix miscellaneous typos (#4275)luzpaz2017-11-051-1/+1
|
* bpo-23699: Use a macro to reduce boilerplate code in rich comparison ↵stratakis2017-11-021-32/+2
| | | | functions (GH-793)
* bpo-31675: Fix memory leaks in Tkinter's methods splitlist() and split() (#3866)Serhiy Storchaka2017-10-031-2/+10
| | | | | when pass a string larger than 2 GiB. Decrease memory requirements for Tcl's bigmem tests.
* bpo-31673: Fixed typo in the name of Tkinter's method adderrorinfo(). (#3864)Serhiy Storchaka2017-10-031-4/+4
|
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-62/+0
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* Use NULL rather than 0. (#778)Serhiy Storchaka2017-03-231-1/+1
| | | | | There was few cases of using literal 0 instead of NULL in the context of pointers. While this was a legitimate C code, using NULL rather than 0 makes the code clearer.
* bpo-24037: Add Argument Clinic converter `bool(accept={int})`. (#485)Serhiy Storchaka2017-03-121-5/+5
|
* bpo-29548: Fix some inefficient call API usage (GH-97)INADA Naoki2017-02-161-7/+4
|
* Added the const qualifier to char* variables that refer to readonly internalSerhiy Storchaka2016-11-201-3/+3
| | | | UTF-8 represenatation of Unicode objects.
* Fixed possible NULL decrefing.Serhiy Storchaka2016-10-281-1/+1
|\
| * Fixed possible NULL decrefing.Serhiy Storchaka2016-10-281-1/+1
| |