[GRASS-SVN] r70286 - grass/trunk/tools
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Jan 6 11:41:24 PST 2017
Author: wenzeslaus
Date: 2017-01-06 11:41:24 -0800 (Fri, 06 Jan 2017)
New Revision: 70286
Modified:
grass/trunk/tools/mkhtml.py
Log:
mkhtml: html and url imports Python 3 compatible
Modified: grass/trunk/tools/mkhtml.py
===================================================================
--- grass/trunk/tools/mkhtml.py 2017-01-06 19:40:09 UTC (rev 70285)
+++ grass/trunk/tools/mkhtml.py 2017-01-06 19:41:24 UTC (rev 70286)
@@ -21,9 +21,19 @@
import string
import re
from datetime import datetime
-from HTMLParser import HTMLParser
-import urlparse
+try:
+ # Python 2 import
+ from HTMLParser import HTMLParser
+except:
+ # Python 3 import
+ from html.parser import HTMLParser
+try:
+ import urlparse
+except:
+ import urllib.parse as urlparse
+
+
pgm = sys.argv[1]
src_file = "%s.html" % pgm
More information about the grass-commit
mailing list