Notification time stamped 2022-04-29 10:11:11 UTC
From ea6fb2f54bbac0c2af71dcc8ad0a37a52d19ae86 Mon Sep 17 00:00:00 2001 From: Tomáš Hrnčiar thrnciar@redhat.com Date: Apr 29 2022 10:08:56 +0000 Subject: Python 3.11: No longer use the undocumented sre_constants module
---
diff --git a/0001-No-longer-use-undocumented-module-sre_constants.patch b/0001-No-longer-use-undocumented-module-sre_constants.patch new file mode 100644 index 0000000..922bd75 --- /dev/null +++ b/0001-No-longer-use-undocumented-module-sre_constants.patch @@ -0,0 +1,42 @@ +From 9da4012a025294413fc1f956e081ee003df2411e Mon Sep 17 00:00:00 2001 +From: Serhiy Storchaka storchaka@gmail.com +Date: Thu, 28 Apr 2022 12:04:55 +0200 +Subject: [PATCH] No longer use undocumented module 'sre_constants' + +--- + pyparsing.py | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/pyparsing.py b/pyparsing.py +index 581d5bb..774222b 100644 +--- a/pyparsing.py ++++ b/pyparsing.py +@@ -105,7 +105,6 @@ import copy + import sys + import warnings + import re +-import sre_constants + import collections + import pprint + import traceback +@@ -3310,7 +3309,7 @@ class Regex(Token): + try: + self.re = re.compile(self.pattern, self.flags) + self.reString = self.pattern +- except sre_constants.error: ++ except re.error: + warnings.warn("invalid pattern (%s) passed to Regex" % pattern, + SyntaxWarning, stacklevel=2) + raise +@@ -3501,7 +3500,7 @@ class QuotedString(Token): + self.re = re.compile(self.pattern, self.flags) + self.reString = self.pattern + self.re_match = self.re.match +- except sre_constants.error: ++ except re.error: + warnings.warn("invalid pattern (%s) passed to Regex" % self.pattern, + SyntaxWarning, stacklevel=2) + raise +-- +2.33.1 + diff --git a/pyparsing.spec b/pyparsing.spec index 3568897..561e620 100644 --- a/pyparsing.spec +++ b/pyparsing.spec @@ -18,6 +18,11 @@ License: MIT URL: https://github.com/pyparsing/pyparsing Source0: https://github.com/%%7Bname%7D/%%7Bname%7D/archive/%%7Bname%7D_%%7Bversion%7...
+# sre_constants module is deprecated in Python 3.11, this patch replaces it with the re module +# Merged upstream in https://github.com/pyparsing/pyparsing/pull/379 +# Included in 3.0.8+ +Patch: 0001-No-longer-use-undocumented-module-sre_constants.patch + BuildArch: noarch BuildRequires: dos2unix BuildRequires: python%{python3_pkgversion}-devel @@ -72,7 +77,8 @@ This is the Python 3 version.
%prep -%setup -q -n %{name}-%{name}_%{version} +%autosetup -p1 -n %{name}-%{name}_%{version} + dos2unix -k CHANGES LICENSE
https://src.fedoraproject.org/rpms/pyparsing/c/ea6fb2f54bbac0c2af71dcc8ad0a3...
scm-commits@lists.fedoraproject.org