Kaynağa Gözat

wxGUI/wms: fix importing ParseError with Python < 2.7

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54620 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 12 yıl önce
ebeveyn
işleme
465f31e791
1 değiştirilmiş dosya ile 5 ekleme ve 2 silme
  1. 5 2
      gui/wxpython/web_services/widgets.py

+ 5 - 2
gui/wxpython/web_services/widgets.py

@@ -20,8 +20,11 @@ import os
 import sys
 import sys
 import shutil
 import shutil
 
 
-from copy                  import deepcopy
-from xml.etree.ElementTree import ParseError
+from copy import deepcopy
+try:
+    from xml.etree.ElementTree import ParseError
+except ImportError: # < Python 2.7
+    from xml.parsers.expat import ExpatError as ParseError
 
 
 import wx
 import wx
 import wx.lib.flatnotebook    as FN
 import wx.lib.flatnotebook    as FN