Skip to content

Commit

Permalink
Merge branch 'python_3.12' of github.com:3-manifolds/frameworks into …
Browse files Browse the repository at this point in the history
…python_3.12
  • Loading branch information
culler committed Oct 12, 2023
2 parents b9701fa + 02c3bd7 commit 8c810ec
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 0 deletions.
1 change: 1 addition & 0 deletions Python-3.12/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ if ! [ -d ${SRC_DIR} ]; then
tar xfz ${SRC_ARCHIVE}
pushd ${SRC_DIR}
patch -p0 < ../patches/configure.patch
patch -p0 < ../patches/tkinter.patch
popd
fi
if ! [ -d dist ]; then
Expand Down
104 changes: 104 additions & 0 deletions Python-3.12/patches/tkinter.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
*** Lib/tkinter/__init__.py.orig Fri Oct 6 09:28:29 2023
--- Lib/tkinter/__init__.py Fri Oct 6 10:38:48 2023
***************
*** 974,980 ****
"""Return None, "local" or "global" if this widget has
no, a local or a global grab."""
status = self.tk.call('grab', 'status', self._w)
! if status == 'none': status = None
return status

def option_add(self, pattern, value, priority = None):
--- 974,980 ----
"""Return None, "local" or "global" if this widget has
no, a local or a global grab."""
status = self.tk.call('grab', 'status', self._w)
! if status == 'none' or not status: status = None
return status

def option_add(self, pattern, value, priority = None):
***************
*** 1086,1092 ****
def winfo_atom(self, name, displayof=0):
"""Return integer which represents atom NAME."""
args = ('winfo', 'atom') + self._displayof(displayof) + (name,)
! return self.tk.getint(self.tk.call(args))

def winfo_atomname(self, id, displayof=0):
"""Return name of atom with identifier ID."""
--- 1086,1092 ----
def winfo_atom(self, name, displayof=0):
"""Return integer which represents atom NAME."""
args = ('winfo', 'atom') + self._displayof(displayof) + (name,)
! return self.tk.getint(self.tk.call(args)) or None

def winfo_atomname(self, id, displayof=0):
"""Return name of atom with identifier ID."""
***************
*** 3107,3113 ****

def get(self):
"""Return the text."""
! return self.tk.call(self._w, 'get')

def icursor(self, index):
"""Insert cursor at INDEX."""
--- 3107,3113 ----

def get(self):
"""Return the text."""
! return str(self.tk.call(self._w, 'get'))

def icursor(self, index):
"""Insert cursor at INDEX."""
***************
*** 3256,3262 ****
def index(self, index):
"""Return index of item identified with INDEX."""
i = self.tk.call(self._w, 'index', index)
! if i == 'none': return None
return self.tk.getint(i)

def insert(self, index, *elements):
--- 3256,3262 ----
def index(self, index):
"""Return index of item identified with INDEX."""
i = self.tk.call(self._w, 'index', index)
! if i == 'none' or not i: return None
return self.tk.getint(i)

def insert(self, index, *elements):
***************
*** 3774,3780 ****

def get(self, index1, index2=None):
"""Return the text from INDEX1 to INDEX2 (not included)."""
! return self.tk.call(self._w, 'get', index1, index2)
# (Image commands are new in 8.0)

def image_cget(self, index, option):
--- 3774,3780 ----

def get(self, index1, index2=None):
"""Return the text from INDEX1 to INDEX2 (not included)."""
! return str(self.tk.call(self._w, 'get', index1, index2))
# (Image commands are new in 8.0)

def image_cget(self, index, option):
***************
*** 4278,4284 ****

def get(self):
"""Returns the spinbox's string"""
! return self.tk.call(self._w, 'get')

def icursor(self, index):
"""Alter the position of the insertion cursor.
--- 4278,4284 ----

def get(self):
"""Returns the spinbox's string"""
! return str(self.tk.call(self._w, 'get'))

def icursor(self, index):
"""Alter the position of the insertion cursor.

0 comments on commit 8c810ec

Please sign in to comment.