wxPython: clear Python 3.12 warning

This commit is contained in:
Đoàn Trần Công Danh 2023-10-10 11:16:52 +07:00
parent d1d3dc04a7
commit 8005fa0e48
2 changed files with 58 additions and 1 deletions

View File

@ -0,0 +1,57 @@
--- a/wx/lib/docview.py
+++ b/wx/lib/docview.py
@@ -1034,7 +1034,7 @@ class DocTemplate(wx.Object):
string will be displayed in the file filter list of Windows file
selectors.
- filter is an appropriate file filter such as \*.txt.
+ filter is an appropriate file filter such as *.txt.
dir is the default directory to use for file selectors.
--- a/wx/lib/layoutf.py
+++ b/wx/lib/layoutf.py
@@ -132,8 +132,8 @@ class Layoutf(wx.LayoutConstraints):
'r': 'wx.Right', 'h': 'wx.Height', 'w': 'wx.Width',
'x': 'wx.CentreX', 'y': 'wx.CentreY' }
- rexp1 = re.compile('^\s*([tlrbhwxy])\s*([!\?\*])\s*(\d*)\s*$')
- rexp2 = re.compile('^\s*([tlrbhwxy])\s*([=%<>^_])\s*([tlrbhwxy]?)\s*(\d*)\s*#(\d+)\s*$')
+ rexp1 = re.compile(r'^\s*([tlrbhwxy])\s*([!\?\*])\s*(\d*)\s*$')
+ rexp2 = re.compile(r'^\s*([tlrbhwxy])\s*([=%<>^_])\s*([tlrbhwxy]?)\s*(\d*)\s*#(\d+)\s*$')
def __init__(self,pstr=None,winlist=None):
wx.LayoutConstraints.__init__(self)
--- a/wx/lib/wxpTag.py
+++ b/wx/lib/wxpTag.py
@@ -45,7 +45,7 @@ The name-value pairs in all the nested P
strings into a python dictionary and passed to the __init__ method of
the class as keyword arguments. This means that they are all
accessible from the __init__ method as regular parameters, or you use
-the special Python \*\*kw syntax in your __init__ method to get the
+the special Python **kw syntax in your __init__ method to get the
dictionary directly.
Some parameter values are special and if they are present then they will
--- a/wx/tools/pywxrc.py
+++ b/wx/tools/pywxrc.py
@@ -521,7 +521,7 @@ class XmlResourceCompiler:
# Generate subclasses
for subclass in subclasses:
windowClass = bases[subclass]
- subclass = re.sub("^\S+\.", "", subclass)
+ subclass = re.sub(r"^\S+\.", "", subclass)
windowClass = re.sub("^wx", "", windowClass)
outputList.append(self.templates.SUBCLASS_HEADER % locals())
outputList.append('\n')
@@ -766,8 +766,8 @@ class XmlResourceCompiler:
\n => \\n
\r => \\r
\t => \\t
- \ => \\
- " => \"
+ \\ => \\\\
+ " => \\"
Returns result as string, which is bytes in py2 or unicode in py3.
"""

View File

@ -1,7 +1,7 @@
# Template file for 'wxPython'
pkgname=wxPython
version=4.2.1
revision=3
revision=4
build_style=python3-module
make_build_args="--skip-build"
make_install_args="--skip-build"