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:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user