File: fix-python3.11-regex.patch

package info (click to toggle)
django-assets 2.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 436 kB
  • sloc: python: 977; makefile: 129; sh: 6
file content (23 lines) | stat: -rw-r--r-- 703 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From e57c5c3c02d84069600916fed74f165819393487 Mon Sep 17 00:00:00 2001
From: Jonatan Heyman <jonatan@heyman.info>
Date: Thu, 10 Nov 2022 23:26:07 +0100
Subject: [PATCH] Global regex flags must be at the start of regex in Python
 3.11

---
 django_assets/glob.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/django_assets/glob.py b/django_assets/glob.py
index 66a9531..73d961c 100644
--- a/django_assets/glob.py
+++ b/django_assets/glob.py
@@ -121,7 +121,7 @@ def translate(pat):
                 res = '%s([%s])' % (res, stuff)
         else:
             res = res + re.escape(c)
-    return res + '\Z(?ms)'
+    return '(?ms)' + res + '\Z'
 
 
 """Filename globbing utility."""