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.
This commit is contained in:
Furgo
2025-10-16 08:17:31 +02:00
parent e74cd082ca
commit 01e87a2072

View File

@@ -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]