8000 gh-103194: Fix Tkinter’s Tcl value type handling for Tcl 8.7/9.0 by chrstphrchvz · Pull Request #103846 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-103194: Fix Tkinter’s Tcl value type handling for Tcl 8.7/9.0 #103846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
May 31, 2024
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
"utf32string" is now registered
  • Loading branch information
chrstphrchvz committed Apr 25, 2023
commit 804d0fd8942a538f0c716cbcbfbb205e46c08abc
15 changes: 1 addition & 14 deletions Modules/_tkinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,26 +618,13 @@ Tkapp_New(const char *screenName, const char *className,
//fprintf(stderr, "%s %p\n", value->typePtr->name, value->typePtr);
v->ByteArrayType = value->typePtr;
Tcl_DecrRefCount(value);

/* Tcl 8.7 has an unregistered "utf32string" type,
which can be retrieved by running `string length`
on a string with at least 2 characters.
If the "utf32string" type is not present,
then this retrieves the "string" type. */
Tcl_SetVar(v->interp, "mystring", "pq", 0);
Tcl_Eval(v->interp, "string length $mystring");
value = Tcl_GetVar2Ex(v->interp, "mystring", NULL, 0);
v->UTF32StringType = value->typePtr;
fprintf(stderr, "%s %p\n",
value->typePtr ? value->typePtr->name : "pure string",
value->typePtr);
Tcl_UnsetVar(v->interp, "mystring", 0);
}
v->DoubleType = Tcl_GetObjType("double");
v->BignumType = Tcl_GetObjType("bignum");
v->ListType = Tcl_GetObjType("list");
v->ProcBodyType = Tcl_GetObjType("procbody");
v->StringType = Tcl_GetObjType("string");
v->UTF32StringType = Tcl_GetObjType("utf32string");

/* Delete the 'exit' command, which can screw things up */
Tcl_DeleteCommand(v->interp, "exit");
Expand Down
0