yorikvanhavre / BIM_Workbench

A BIM Workbench for FreeCAD
363 stars 77 forks source link

BimTutorial.py does not work with Python 3.11 #113

Closed psommerfeld closed 1 year ago

psommerfeld commented 1 year ago

Using inline flags mid-expression was deprecated in Python 3.6. This change is required:

diff --git a/BimTutorial.py b/BimTutorial.py
index 968ae19..751d3b7 100644
--- a/BimTutorial.py
+++ b/BimTutorial.py
@@ -152,7 +152,7 @@ class BIM_Tutorial:
                 if not os.path.exists(store):
                     os.makedirs(store)
                 for path in imagepaths:
-                    name = re.findall("[\\w.-]+\\.(?i)(?:jpg|png|gif|bmp)",path)
+                    name = re.findall("(?i)[\\w.-]+\\.(?:jpg|png|gif|bmp)",path)
                     if name:
                         name = name[-1]
                         storename = os.path.join(store,name)
yorikvanhavre commented 1 year ago

Thanks!