[GRASS-SVN] r74323 - grass/trunk/scripts/g.extension
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Mar 27 15:15:50 PDT 2019
Author: neteler
Date: 2019-03-27 15:15:49 -0700 (Wed, 27 Mar 2019)
New Revision: 74323
Modified:
grass/trunk/scripts/g.extension/g.extension.py
Log:
g.extension: import requests for python3 as well as continuation of r74116 (fixes #3803) (contributed by pmav99)
Modified: grass/trunk/scripts/g.extension/g.extension.py
===================================================================
--- grass/trunk/scripts/g.extension/g.extension.py 2019-03-27 21:57:18 UTC (rev 74322)
+++ grass/trunk/scripts/g.extension/g.extension.py 2019-03-27 22:15:49 UTC (rev 74323)
@@ -135,10 +135,11 @@
import shutil
import zipfile
import tempfile
+import xml.etree.ElementTree as etree
from distutils.dir_util import copy_tree
+
try:
- import requests, zipfile
from urllib2 import HTTPError, URLError, ProxyHandler, build_opener
from urllib import urlopen, urlretrieve
except ImportError:
@@ -146,10 +147,8 @@
from urllib.error import HTTPError, URLError
from urllib.request import urlopen, urlretrieve, ProxyHandler, build_opener
-try:
- import xml.etree.ElementTree as etree
-except ImportError:
- import elementtree.ElementTree as etree # Python <= 2.4
+import requests
+
# Get the XML parsing exceptions to catch. The behavior changed with Python 2.7
# and ElementTree 1.3.
from xml.parsers import expat # TODO: works for any Python?
More information about the grass-commit
mailing list