From 01e87a2072c97787b8d2197c7b2f6f04f75c2a12 Mon Sep 17 00:00:00 2001 From: Furgo <148809153+furgo16@users.noreply.github.com> Date: Thu, 16 Oct 2025 08:17:31 +0200 Subject: [PATCH] BIM: remove obsolete Python 2 urllib2 import Python 3 combined the former `urllib`, `urllib2`, `urlparse` Python 2 modules into subpackages of `urllib`. FreeCAD is written in Python 3, thus the `urllib2` import fallback will not work and needs to be removed. --- src/Mod/BIM/ArchCommands.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Mod/BIM/ArchCommands.py b/src/Mod/BIM/ArchCommands.py index d06978bb22..4ee234cc2a 100644 --- a/src/Mod/BIM/ArchCommands.py +++ b/src/Mod/BIM/ArchCommands.py @@ -759,10 +759,7 @@ def download(url, force=False): """download(url,force=False): downloads a file from the given URL and saves it in the macro path. Returns the path to the saved file. If force is True, the file will be downloaded again evn if it already exists.""" - try: - from urllib.request import urlopen - except ImportError: - from urllib2 import urlopen + from urllib.request import urlopen import os name = url.split("/")[-1]