74 lines
2.6 KiB
Diff
74 lines
2.6 KiB
Diff
From 187738483489794693ee464050ccc6d070ac2dfb Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <thrnciar@redhat.com>
|
|
Date: Tue, 19 Apr 2022 14:23:21 +0200
|
|
Subject: [PATCH] No longer use undocumented module 'sre_constants'
|
|
|
|
---
|
|
pkg_resources/_vendor/pyparsing.py | 5 ++---
|
|
setuptools/_vendor/pyparsing.py | 5 ++---
|
|
2 files changed, 4 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/pkg_resources/_vendor/pyparsing.py b/pkg_resources/_vendor/pyparsing.py
|
|
index cf75e1e..5ecc692 100644
|
|
--- a/pkg_resources/_vendor/pyparsing.py
|
|
+++ b/pkg_resources/_vendor/pyparsing.py
|
|
@@ -84,7 +84,6 @@ import copy
|
|
import sys
|
|
import warnings
|
|
import re
|
|
-import sre_constants
|
|
import collections
|
|
import pprint
|
|
import traceback
|
|
@@ -2791,7 +2790,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
|
|
@@ -2915,7 +2914,7 @@ class QuotedString(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" % self.pattern,
|
|
SyntaxWarning, stacklevel=2)
|
|
raise
|
|
diff --git a/setuptools/_vendor/pyparsing.py b/setuptools/_vendor/pyparsing.py
|
|
index cf75e1e..5ecc692 100644
|
|
--- a/setuptools/_vendor/pyparsing.py
|
|
+++ b/setuptools/_vendor/pyparsing.py
|
|
@@ -84,7 +84,6 @@ import copy
|
|
import sys
|
|
import warnings
|
|
import re
|
|
-import sre_constants
|
|
import collections
|
|
import pprint
|
|
import traceback
|
|
@@ -2791,7 +2790,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
|
|
@@ -2915,7 +2914,7 @@ class QuotedString(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" % self.pattern,
|
|
SyntaxWarning, stacklevel=2)
|
|
raise
|
|
--
|
|
2.33.1
|
|
|