Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-exrex for openSUSE:Factory 
checked in at 2023-02-28 12:48:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-exrex (Old)
 and      /work/SRC/openSUSE:Factory/.python-exrex.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-exrex"

Tue Feb 28 12:48:56 2023 rev:6 rq:1068052 version:0.10.5+git119

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-exrex/python-exrex.changes        
2021-03-05 13:50:39.947916412 +0100
+++ /work/SRC/openSUSE:Factory/.python-exrex.new.31432/python-exrex.changes     
2023-02-28 12:49:19.092733011 +0100
@@ -1,0 +2,5 @@
+Mon Feb 27 19:06:55 UTC 2023 - Sebastian Wagner <se...@sebix.at>
+
+- add fix-python-3.11.patch from upstream PR #65 to fix the build on Python 
3.11.
+
+-------------------------------------------------------------------

New:
----
  fix-python-3.11.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-exrex.spec ++++++
--- /var/tmp/diff_new_pack.csWUU5/_old  2023-02-28 12:49:19.548735515 +0100
+++ /var/tmp/diff_new_pack.csWUU5/_new  2023-02-28 12:49:19.552735537 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-exrex
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,7 +16,6 @@
 #
 
 
-%{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define revision fd1e21ffc7c16fd5637a5c440224766417e840f9
 %define skip_python2 1
 Name:           python-exrex
@@ -30,12 +29,14 @@
 Source:         
https://github.com/asciimoo/exrex/archive/%{revision}.tar.gz#/exrex-%{version}.tar.gz
 # PATCH-FIX-UPSTREAM fix-setup-encoding.patch
 Patch0:         
https://github.com/asciimoo/exrex/pull/53.patch#/fix-setup-encoding.patch
+# PATCH-FIX-UPSTREAM fix-python-3.11.patch
+Patch1:         
https://github.com/asciimoo/exrex/pull/65.patch#/fix-python-3.11.patch
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
 Requires:       python-setuptools
 Requires(post): update-alternatives
-Requires(postun): update-alternatives
+Requires(postun):update-alternatives
 BuildArch:      noarch
 %python_subpackages
 
@@ -46,6 +47,7 @@
 %setup -q -n exrex-%{revision}
 sed -i '1s/^#!.*//' exrex.py
 %patch0 -p1
+%patch1 -p1
 
 %build
 %python_build
@@ -67,7 +69,9 @@
 %python_uninstall_alternative exrex
 
 %files %{python_files}
-%{python_sitelib}/*
+%{python_sitelib}/exrex*
+%{python_sitelib}/__pycache__/exrex.*
+%{python_sitelib}/exrex-0.10.6*-info
 %license COPYING
 %doc README.md doc/
 %python_alternative %{_bindir}/exrex

++++++ fix-python-3.11.patch ++++++
>From 44712bfb1350a509581a5834d9fa8aebcd9434db Mon Sep 17 00:00:00 2001
From: Michael Souza <119819695+sumsl...@users.noreply.github.com>
Date: Sat, 10 Dec 2022 21:52:13 -0800
Subject: [PATCH] Fix: Import error sre_parse

sre_parse module was moved in py3.11
---
 exrex.py | 6 +++++-
 tests.py | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/exrex.py b/exrex.py
index 24c0de9..be74f92 100644
--- a/exrex.py
+++ b/exrex.py
@@ -22,7 +22,11 @@
     from future_builtins import map, range
 except:
     pass
-from re import match, sre_parse, U
+from re import match, U
+try:
+    import re._parser as sre_parse
+except ImportError: # Python < 3.11
+    from re import sre_parse
 from itertools import tee
 from random import choice, randint
 from types import GeneratorType
diff --git a/tests.py b/tests.py
index 8a8a63e..ef0d42c 100644
--- a/tests.py
+++ b/tests.py
@@ -20,8 +20,12 @@
 
 from exrex import generate, count, getone, CATEGORIES, simplify
 import re
-import sre_parse
+try: 
+    import re._parser as sre_parse
+except ImportError: # Python < 3.11
+    from re import sre_parse
 from sys import exit, version_info
+
 IS_PY3 = version_info[0] == 3
 
 RS = {

Reply via email to