[GRASS-SVN] r60217 - in grass/branches/releasebranch_7_0: doc/gui/wxpython/example gui/wxpython gui/wxpython/animation gui/wxpython/core gui/wxpython/dbmgr gui/wxpython/gcp gui/wxpython/gmodeler gui/wxpython/gui_core gui/wxpython/iclass gui/wxpython/icons gui/wxpython/iscatt gui/wxpython/lmgr gui/wxpython/location_wizard gui/wxpython/mapdisp gui/wxpython/mapwin gui/wxpython/modules gui/wxpython/nviz gui/wxpython/psmap gui/wxpython/timeline gui/wxpython/tools gui/wxpython/vdigit gui/wxpython/wxplot lib/init lib/python/ctypes lib/python/ctypes/ctypesgencore lib/python/ctypes/ctypesgencore/parser lib/python/ctypes/ctypesgencore/processor lib/python/pydispatch lib/python/script lib/python/temporal man scripts/d.redraw scripts/g.extension scripts/g.extension.all scripts/r.in.wms scripts/r.pack scripts/v.krige temporal/t.register tools tools/g.html2man

svn_grass at osgeo.org svn_grass at osgeo.org
Mon May 12 22:11:15 PDT 2014


Author: neteler
Date: 2014-05-12 22:11:15 -0700 (Mon, 12 May 2014)
New Revision: 60217

Modified:
   grass/branches/releasebranch_7_0/doc/gui/wxpython/example/frame.py
   grass/branches/releasebranch_7_0/gui/wxpython/animation/controller.py
   grass/branches/releasebranch_7_0/gui/wxpython/animation/data.py
   grass/branches/releasebranch_7_0/gui/wxpython/animation/dialogs.py
   grass/branches/releasebranch_7_0/gui/wxpython/animation/temporal_manager.py
   grass/branches/releasebranch_7_0/gui/wxpython/core/gcmd.py
   grass/branches/releasebranch_7_0/gui/wxpython/core/gconsole.py
   grass/branches/releasebranch_7_0/gui/wxpython/core/globalvar.py
   grass/branches/releasebranch_7_0/gui/wxpython/core/render.py
   grass/branches/releasebranch_7_0/gui/wxpython/core/settings.py
   grass/branches/releasebranch_7_0/gui/wxpython/core/toolboxes.py
   grass/branches/releasebranch_7_0/gui/wxpython/core/utils.py
   grass/branches/releasebranch_7_0/gui/wxpython/dbmgr/base.py
   grass/branches/releasebranch_7_0/gui/wxpython/gcp/manager.py
   grass/branches/releasebranch_7_0/gui/wxpython/gis_set.py
   grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/frame.py
   grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/model.py
   grass/branches/releasebranch_7_0/gui/wxpython/gui_core/forms.py
   grass/branches/releasebranch_7_0/gui/wxpython/gui_core/goutput.py
   grass/branches/releasebranch_7_0/gui/wxpython/gui_core/gselect.py
   grass/branches/releasebranch_7_0/gui/wxpython/gui_core/prompt.py
   grass/branches/releasebranch_7_0/gui/wxpython/gui_core/simplelmgr.py
   grass/branches/releasebranch_7_0/gui/wxpython/iclass/frame.py
   grass/branches/releasebranch_7_0/gui/wxpython/iclass/statistics.py
   grass/branches/releasebranch_7_0/gui/wxpython/icons/icon.py
   grass/branches/releasebranch_7_0/gui/wxpython/iscatt/core_c.py
   grass/branches/releasebranch_7_0/gui/wxpython/lmgr/frame.py
   grass/branches/releasebranch_7_0/gui/wxpython/location_wizard/dialogs.py
   grass/branches/releasebranch_7_0/gui/wxpython/location_wizard/wizard.py
   grass/branches/releasebranch_7_0/gui/wxpython/mapdisp/main.py
   grass/branches/releasebranch_7_0/gui/wxpython/mapdisp/statusbar.py
   grass/branches/releasebranch_7_0/gui/wxpython/mapwin/analysis.py
   grass/branches/releasebranch_7_0/gui/wxpython/mapwin/buffered.py
   grass/branches/releasebranch_7_0/gui/wxpython/modules/colorrules.py
   grass/branches/releasebranch_7_0/gui/wxpython/modules/extensions.py
   grass/branches/releasebranch_7_0/gui/wxpython/nviz/main.py
   grass/branches/releasebranch_7_0/gui/wxpython/nviz/mapwindow.py
   grass/branches/releasebranch_7_0/gui/wxpython/nviz/tools.py
   grass/branches/releasebranch_7_0/gui/wxpython/psmap/dialogs.py
   grass/branches/releasebranch_7_0/gui/wxpython/psmap/frame.py
   grass/branches/releasebranch_7_0/gui/wxpython/psmap/instructions.py
   grass/branches/releasebranch_7_0/gui/wxpython/timeline/g.gui.timeline.py
   grass/branches/releasebranch_7_0/gui/wxpython/tools/update_menudata.py
   grass/branches/releasebranch_7_0/gui/wxpython/vdigit/main.py
   grass/branches/releasebranch_7_0/gui/wxpython/wxgui.py
   grass/branches/releasebranch_7_0/gui/wxpython/wxplot/base.py
   grass/branches/releasebranch_7_0/gui/wxpython/wxplot/histogram.py
   grass/branches/releasebranch_7_0/gui/wxpython/wxplot/profile.py
   grass/branches/releasebranch_7_0/gui/wxpython/wxplot/scatter.py
   grass/branches/releasebranch_7_0/lib/init/grass.py
   grass/branches/releasebranch_7_0/lib/python/ctypes/ctypesgencore/libraryloader.py
   grass/branches/releasebranch_7_0/lib/python/ctypes/ctypesgencore/parser/lex.py
   grass/branches/releasebranch_7_0/lib/python/ctypes/ctypesgencore/parser/pplexer.py
   grass/branches/releasebranch_7_0/lib/python/ctypes/ctypesgencore/parser/yacc.py
   grass/branches/releasebranch_7_0/lib/python/ctypes/ctypesgencore/processor/operations.py
   grass/branches/releasebranch_7_0/lib/python/ctypes/loader.py
   grass/branches/releasebranch_7_0/lib/python/pydispatch/robust.py
   grass/branches/releasebranch_7_0/lib/python/pydispatch/saferef.py
   grass/branches/releasebranch_7_0/lib/python/script/core.py
   grass/branches/releasebranch_7_0/lib/python/script/task.py
   grass/branches/releasebranch_7_0/lib/python/temporal/gui_support.py
   grass/branches/releasebranch_7_0/man/build_html.py
   grass/branches/releasebranch_7_0/man/build_rest.py
   grass/branches/releasebranch_7_0/scripts/d.redraw/d.redraw.py
   grass/branches/releasebranch_7_0/scripts/g.extension.all/g.extension.all.py
   grass/branches/releasebranch_7_0/scripts/g.extension/g.extension.py
   grass/branches/releasebranch_7_0/scripts/r.in.wms/wms_base.py
   grass/branches/releasebranch_7_0/scripts/r.in.wms/wms_drv.py
   grass/branches/releasebranch_7_0/scripts/r.pack/r.pack.py
   grass/branches/releasebranch_7_0/scripts/v.krige/v.krige.py
   grass/branches/releasebranch_7_0/temporal/t.register/t.register.py
   grass/branches/releasebranch_7_0/tools/g.html2man/g.html2man.py
   grass/branches/releasebranch_7_0/tools/reindent.py
Log:
Python3 support: exception objects require 'as' keyword (compliant with Python >= 2.6) (trac #2288)

Modified: grass/branches/releasebranch_7_0/doc/gui/wxpython/example/frame.py
===================================================================
--- grass/branches/releasebranch_7_0/doc/gui/wxpython/example/frame.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/doc/gui/wxpython/example/frame.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -46,7 +46,7 @@
 #     from grass.lib.raster import *
 #     haveExample = True
 #     errMsg = ''
-# except ImportError, e:
+# except ImportError as e:
 #     haveExample = False
 #     errMsg = _("Loading raster lib failed.\n%s") % e
 

Modified: grass/branches/releasebranch_7_0/gui/wxpython/animation/controller.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/animation/controller.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/animation/controller.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -242,7 +242,7 @@
             return
         try:
             temporalMode, tempManager = self.EvaluateInput(self.animationData + [animData])
-        except GException, e:
+        except GException as e:
             GError(parent=self.frame, message=e.value, showTraceback=False)
             return
         # if ok, set temporal mode
@@ -273,7 +273,7 @@
             return
         try:
             temporalMode, tempManager = self.EvaluateInput(animationData)
-        except GException, e:
+        except GException as e:
             GError(parent=self.frame, message=e.value, showTraceback=False)
             return
         self.animationData = animationData
@@ -561,7 +561,7 @@
                          duration=self.timeTick / float(1000),
                          encoding=exportInfo['encoding'],
                          inputOptions=exportInfo['options'])
-        except Exception, e:
+        except Exception as e:
             del busy
             GError(parent=self.frame, message=str(e))
             return

Modified: grass/branches/releasebranch_7_0/gui/wxpython/animation/data.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/animation/data.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/animation/data.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -277,7 +277,7 @@
                 try:
                     name = validateTimeseriesName(name, self._mapType)
                     self._maps = getRegisteredMaps(name, self._mapType)
-                except (GException, gcore.ScriptError), e:
+                except (GException, gcore.ScriptError) as e:
                     raise ValueError(str(e))
             else:
                 self._maps = validateMapNames(name.split(','), self._mapType)

Modified: grass/branches/releasebranch_7_0/gui/wxpython/animation/dialogs.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/animation/dialogs.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/animation/dialogs.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -727,7 +727,7 @@
             return
         try:
             temporalMode, tempManager = self.eval(self.animationData)
-        except GException, e:
+        except GException as e:
             GError(parent=self, message=e.value, showTraceback=False)
             return
         self.result = (self.animationData, temporalMode, tempManager)
@@ -1392,7 +1392,7 @@
                     if maps:
                         mapName, mapLayer = getNameAndLayer(maps[0])
                         cmd.append('map={name}'.format(name=mapName))
-                except gcore.ScriptError, e:
+                except gcore.ScriptError as e:
                     GError(parent=self, message=str(e), showTraceback=False)
                     return None
         return cmd
@@ -1444,7 +1444,7 @@
                 self.layer.name = self._name
                 self.layer.cmd = self._cmd
                 event.Skip()
-            except (GException, gcore.ScriptError), e:
+            except (GException, gcore.ScriptError) as e:
                 GError(parent=self, message=str(e))
 
     def GetLayer(self):

Modified: grass/branches/releasebranch_7_0/gui/wxpython/animation/temporal_manager.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/animation/temporal_manager.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/animation/temporal_manager.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -354,7 +354,7 @@
     try:
         warn = temp.EvaluateInputData()
         print warn
-    except GException, e:
+    except GException as e:
         print e
         return
 

Modified: grass/branches/releasebranch_7_0/gui/wxpython/core/gcmd.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/core/gcmd.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/core/gcmd.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -213,7 +213,7 @@
                 (errCode, written) = WriteFile(x, input)
             except ValueError:
                 return self._close('stdin')
-            except (subprocess.pywintypes.error, Exception), why:
+            except (subprocess.pywintypes.error, Exception) as why:
                 if why[0] in (109, errno.ESHUTDOWN):
                     return self._close('stdin')
                 raise
@@ -234,7 +234,7 @@
                     (errCode, read) = ReadFile(x, nAvail, None)
             except ValueError:
                 return self._close(which)
-            except (subprocess.pywintypes.error, Exception), why:
+            except (subprocess.pywintypes.error, Exception) as why:
                 if why[0] in (109, errno.ESHUTDOWN):
                     return self._close(which)
                 raise
@@ -253,7 +253,7 @@
 
             try:
                 written = os.write(self.stdin.fileno(), input)
-            except OSError, why:
+            except OSError as why:
                 if why[0] == errno.EPIPE: #broken pipe
                     return self._close('stdin')
                 raise
@@ -556,7 +556,7 @@
                                 shell = sys.platform == "win32",
                                 env = self.env)
             
-        except OSError, e:
+        except OSError as e:
             self.error = str(e)
             print >> sys.stderr, e
             return 1

Modified: grass/branches/releasebranch_7_0/gui/wxpython/core/gconsole.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/core/gconsole.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/core/gconsole.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -466,7 +466,7 @@
                 # other GRASS commands (r|v|g|...)
                 try:
                     task = GUI(show=None).ParseCommand(command)
-                except GException, e:
+                except GException as e:
                     GError(parent=self._guiparent,
                            message=unicode(e),
                            showTraceback=False)
@@ -494,7 +494,7 @@
                     # no arguments given
                     try:
                         GUI(parent=self._guiparent, giface=self._giface).ParseCommand(command)
-                    except GException, e:
+                    except GException as e:
                         print >> sys.stderr, e
                     return
 
@@ -643,7 +643,7 @@
         # find which maps were created
         try:
             task = GUI(show=None).ParseCommand(event.cmd)
-        except GException, e:
+        except GException as e:
             print >> sys.stderr, e
             task = None
             return
@@ -678,7 +678,7 @@
                                     env['MAPSET'],
                                     '.bash_history')
             fileHistory = codecs.open(filePath, encoding='utf-8', mode='a')
-        except IOError, e:
+        except IOError as e:
             GError(_("Unable to write file '%(filePath)s'.\n\nDetails: %(error)s") % 
                     {'filePath': filePath, 'error': e},
                    parent=self._guiparent)

Modified: grass/branches/releasebranch_7_0/gui/wxpython/core/globalvar.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/core/globalvar.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/core/globalvar.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -58,7 +58,7 @@
     try:
         try:
             import wxversion
-        except ImportError, e:
+        except ImportError as e:
             raise ImportError(e)
         # wxversion.select(str(minVersion[0]) + '.' + str(minVersion[1]))
         wxversion.ensureMinimal(str(minVersion[0]) + '.' + str(minVersion[1]))
@@ -68,14 +68,14 @@
         if map(int, version.split('.')) < minVersion:
             raise ValueError('Your wxPython version is %s.%s.%s.%s' % tuple(version.split('.')))
 
-    except ImportError, e:
+    except ImportError as e:
         print >> sys.stderr, 'ERROR: wxGUI requires wxPython. %s' % str(e)
         sys.exit(1)
-    except (ValueError, wxversion.VersionError), e:
+    except (ValueError, wxversion.VersionError) as e:
         print >> sys.stderr, 'ERROR: wxGUI requires wxPython >= %d.%d.%d.%d. ' % tuple(minVersion) + \
             '%s.' % (str(e))
         sys.exit(1)
-    except locale.Error, e:
+    except locale.Error as e:
         print >> sys.stderr, "Unable to set locale:", e
         os.environ['LC_ALL'] = ''
 

Modified: grass/branches/releasebranch_7_0/gui/wxpython/core/render.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/core/render.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/core/render.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -488,7 +488,7 @@
                                  "WIND")
         try:
             windfile = open (filename, "r")
-        except IOError, e:
+        except IOError as e:
             sys.exit(_("Error: Unable to open '%(file)s'. Reason: %(ret)s. wxGUI exited.\n") % \
                          { 'file' : filename, 'ret' : e})
         
@@ -496,7 +496,7 @@
             line = line.strip()
             try:
                 key, value = line.split(":", 1)
-            except ValueError, e:
+            except ValueError as e:
                 sys.stderr.write(_("\nERROR: Unable to read WIND file: %s\n") % e)
                 return None
             

Modified: grass/branches/releasebranch_7_0/gui/wxpython/core/settings.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/core/settings.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/core/settings.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -44,7 +44,7 @@
         self.userSettings = copy.deepcopy(self.defaultSettings)
         try:
             self.ReadSettingsFile()
-        except GException, e:
+        except GException as e:
             print >> sys.stderr, e.value
         
         # define internal settings
@@ -971,7 +971,7 @@
                     value = self._parseValue(value, read = True)
                     self.Append(settings, group, key, subkey, value)
                     idx += 2
-        except ValueError, e:
+        except ValueError as e:
             print >> sys.stderr, _("Error: Reading settings from file <%(file)s> failed.\n"
                                    "\t\tDetails: %(detail)s\n"
                                    "\t\tLine: '%(line)s'\n") % { 'file' : filename,
@@ -1024,9 +1024,9 @@
                                     type(settings[group][key][subkeys[idx + 1]]) != types.DictType:
                                 file.write('%s' % self.sep)
                     file.write(os.linesep)
-        except IOError, e:
+        except IOError as e:
             raise GException(e)
-        except StandardError, e:
+        except StandardError as e:
             raise GException(_('Writing settings to file <%(file)s> failed.'
                                '\n\nDetails: %(detail)s') % { 'file' : self.filePath,
                                                               'detail' : e })

Modified: grass/branches/releasebranch_7_0/gui/wxpython/core/toolboxes.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/core/toolboxes.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/core/toolboxes.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -162,7 +162,7 @@
     if not os.path.exists(path):
         try:
             os.mkdir(path)
-        except OSError, e:
+        except OSError as e:
             # we cannot use GError or similar because the gui doesn''t start at all
             gcore.warning('%(reason)s\n%(detail)s' % 
                     ({'reason':_('Unable to create toolboxes directory.'),

Modified: grass/branches/releasebranch_7_0/gui/wxpython/core/utils.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/core/utils.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/core/utils.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -558,7 +558,7 @@
                 code, params = line.split(" ", 1)
                 try:
                     code = int(code.replace('<', '').replace('>', ''))
-                except ValueError, e:
+                except ValueError as e:
                     return e
             
             if code is not None:
@@ -566,7 +566,7 @@
                 code = None
         
         f.close()
-    except StandardError, e:
+    except StandardError as e:
         return e
     
     return epsgCodeDict
@@ -622,7 +622,7 @@
                     listOfLocations.append(os.path.basename(location))
             except:
                 pass
-    except UnicodeEncodeError, e:
+    except UnicodeEncodeError as e:
         raise e
     
     ListSortLower(listOfLocations)
@@ -838,7 +838,7 @@
     try:
         verFd = open(os.path.join(globalvar.ETCDIR, "VERSIONNUMBER"))
         version = int(verFd.readlines()[0].split(' ')[0].split('.')[0])
-    except (IOError, ValueError, TypeError, IndexError), e:
+    except (IOError, ValueError, TypeError, IndexError) as e:
         sys.exit(_("ERROR: Unable to determine GRASS version. Details: %s") % e)
     
     verFd.close()
@@ -873,14 +873,14 @@
     if os.path.exists(envFile):
         try:
             fd = open(envFile)
-        except IOError, e:
+        except IOError as e:
             sys.stderr.write(_("Unable to open file '%s'\n") % envFile)
             return
         for line in fd.readlines():
             line = line.rstrip(os.linesep)
             try:
                 k, v = map(lambda x: x.strip(), line.split(' ', 1)[1].split('=', 1))
-            except StandardError, e:
+            except StandardError as e:
                 sys.stderr.write(_("%s: line skipped - unable to parse '%s'\n"
                                    "Reason: %s\n") % (envFile, line, e))
                 lineSkipped.append(line)
@@ -901,7 +901,7 @@
     # write update env file
     try:
         fd = open(envFile, 'w')
-    except IOError, e:
+    except IOError as e:
         sys.stderr.write(_("Unable to create file '%s'\n") % envFile)
         return
     if windows:

Modified: grass/branches/releasebranch_7_0/gui/wxpython/dbmgr/base.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/dbmgr/base.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/dbmgr/base.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -87,7 +87,7 @@
         
         try:
             keyColumn = self.LoadData(layer)
-        except GException, e:
+        except GException as e:
             GError(parent = self,
                    message = e.value)
             return
@@ -308,7 +308,7 @@
             if not cat and keyId > -1 and keyId == j:
                 try:
                     cat = self.columns[columns[j]]['ctype'] (value)
-                except ValueError, e:
+                except ValueError as e:
                     cat = -1
                     GError(parent = self,
                            message = _("Error loading attribute data. "
@@ -1344,7 +1344,7 @@
                             updateList.append("%s=%s" % (columnName[i], values[i]))
                     else: # -> NULL
                         updateList.append("%s=NULL" % (columnName[i]))
-            except ValueError, err:
+            except ValueError as err:
                 GError(parent = self,
                        message = _("Unable to update existing record.\n%s") % err,
                        showTraceback = False)
@@ -1447,7 +1447,7 @@
                     else:
                         valuesString += "%s," % values[i]
                 
-            except ValueError, err:
+            except ValueError as err:
                 GError(parent = self,
                        message = _("Unable to insert new record.\n%s") % err,
                        showTraceback = False)
@@ -1803,7 +1803,7 @@
                     keyColumn = listWin.LoadData(self.selLayer, where = whereCol + whereOpe + whereVal)
                 else:
                     keyColumn = listWin.LoadData(self.selLayer)
-            except GException, e:
+            except GException as e:
                 GError(parent = self,
                        message = _("Loading attribute data failed.\n\n%s") % e.value)
                 self.FindWindowById(self.layerPage[self.selLayer]['where']).SetValue('')
@@ -1828,7 +1828,7 @@
                 try:
                     keyColumn = listWin.LoadData(self.selLayer, columns = cols,
                                                  where = where, sql = sql)
-                except GException, e:
+                except GException as e:
                     GError(parent = self,
                            message = _("Loading attribute data failed.\n\n%s") % e.value)
                     win.SetValue("SELECT * FROM %s" % self.dbMgrData['mapDBInfo'].layers[self.selLayer]['table'])

Modified: grass/branches/releasebranch_7_0/gui/wxpython/gcp/manager.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gcp/manager.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gcp/manager.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -1238,7 +1238,7 @@
                 coord3 = self.list.GetItem(index, 4).GetText()
                 f.write(coord0 + ' ' + coord1 + '     ' + coord2 + ' ' + coord3 + '     ' + check + '\n')
 
-        except IOError, err:
+        except IOError as err:
             GError(parent = self,
                    message="%s <%s>. %s%s" % (_("Writing POINTS file failed"),
                                               self.file['points'], os.linesep, err))
@@ -1295,7 +1295,7 @@
                     self.list.CheckItem(index, check)
                 GCPcnt += 1
 
-        except IOError, err:
+        except IOError as err:
             GError(parent = self,
                    message = "%s <%s>. %s%s" % (_("Reading POINTS file failed"),
                                                 self.file['points'], os.linesep, err))

Modified: grass/branches/releasebranch_7_0/gui/wxpython/gis_set.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gis_set.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gis_set.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -406,7 +406,7 @@
                 for line in rc.readlines():
                     try:
                         key, val = line.split(":", 1)
-                    except ValueError, e:
+                    except ValueError as e:
                         sys.stderr.write(_('Invalid line in GISRC file (%s):%s\n' % \
                                                (e, line)))
                     grassrc[key.strip()] = DecodeString(val.strip())
@@ -593,7 +593,7 @@
                               os.path.join(self.gisdbase, location, newmapset))
                     self.OnSelectLocation(None)
                     self.lbmapsets.SetSelection(self.listOfMapsets.index(newmapset))
-                except StandardError, e:
+                except StandardError as e:
                     wx.MessageBox(parent = self,
                                   caption = _('Error'),
                                   message = _('Unable to rename mapset.\n\n%s') % e,
@@ -630,7 +630,7 @@
                     self.UpdateLocations(self.gisdbase)
                     self.lblocations.SetSelection(self.listOfLocations.index(newlocation))
                     self.UpdateMapsets(newlocation)
-                except StandardError, e:
+                except StandardError as e:
                     wx.MessageBox(parent = self,
                                   caption = _('Error'),
                                   message = _('Unable to rename location.\n\n%s') % e,
@@ -887,7 +887,7 @@
             self.lbmapsets.SetSelection(self.listOfMapsets.index(mapset))
             self.bstart.SetFocus()
             return True
-        except StandardError, e:
+        except StandardError as e:
             GError(parent = self,
                    message = _("Unable to create new mapset: %s") % e,
                    showTraceback = False)
@@ -930,7 +930,7 @@
                 if ret == wx.ID_YES:
                     try:
                         os.remove(lockfile)
-                    except IOError, e:
+                    except IOError as e:
                         GError(_("Unable to remove '%(lock)s'.\n\n"
                                  "Details: %(reason)s") % { 'lock' : lockfile, 'reason' : e})
                 else:

Modified: grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/frame.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/frame.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/frame.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -861,7 +861,7 @@
         """
         try:
             self.model.LoadModel(filename)
-        except GException, e:
+        except GException as e:
             GError(parent = self,
                    message = _("Reading model file <%s> failed.\n"
                                "Invalid file, unable to parse XML document.\n\n%s") % \
@@ -1706,7 +1706,7 @@
         try:
             fd = open(self.filename, "w")
             fd.write(self.body.GetText())
-        except IOError, e:
+        except IOError as e:
             GError(_("Unable to launch Python script. %s") % e,
                    parent = self)
             return

Modified: grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/model.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/model.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/model.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -294,7 +294,7 @@
         # parse workspace file
         try:
             gxmXml = ProcessModelFile(etree.parse(filename))
-        except StandardError, e:
+        except StandardError as e:
             raise GException(e)
         
         if self.canvas:

Modified: grass/branches/releasebranch_7_0/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gui_core/forms.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gui_core/forms.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -697,7 +697,7 @@
                     cmd[0] = self.task.path # full path
                 
                 ret = self._gconsole.RunCmd(cmd, onDone = self.OnDone)
-            except AttributeError, e:
+            except AttributeError as e:
                 print >> sys.stderr, "%s: Probably not running in wxgui.py session?" % (e)
                 print >> sys.stderr, "parent window is: %s" % (str(self.parent))
         else:
@@ -1829,7 +1829,7 @@
         data = ''
         try:
             f = open(path, "r")
-        except IOError, e:
+        except IOError as e:
             gcmd.GError(parent = self, showTraceback = False,
                         message = _("Unable to load file.\n\nReason: %s") % e)
             return
@@ -2204,7 +2204,7 @@
         try:
             cmd = self.task.get_cmd(ignoreErrors = ignoreErrors,
                                    ignoreRequired = ignoreRequired)
-        except ValueError, err:
+        except ValueError as err:
             dlg = wx.MessageDialog(parent = self,
                                    message = unicode(err),
                                    caption = _("Error in %s") % self.task.name,
@@ -2290,7 +2290,7 @@
             global _blackList
             self.grass_task = gtask.parse_interface(gcmd.GetRealCmd(cmd[0]),
                                                     blackList = _blackList)
-        except (grass.ScriptError, ValueError), e:
+        except (grass.ScriptError, ValueError) as e:
             raise gcmd.GException(e.value)
         
         # if layer parameters previously set, re-insert them into dialog

Modified: grass/branches/releasebranch_7_0/gui/wxpython/gui_core/goutput.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gui_core/goutput.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gui_core/goutput.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -383,7 +383,7 @@
             try:
                 output = open(path, "w")
                 output.write(text)
-            except IOError, e:
+            except IOError as e:
                 GError(_("Unable to write file '%(path)s'.\n\nDetails: %(error)s") % {'path': path, 'error': e})
             finally:
                 output.close()
@@ -436,7 +436,7 @@
             output.write('\n'.join(cmds))
             if len(cmds) > 0:
                 output.write('\n')
-        except IOError, e:
+        except IOError as e:
             GError(_("Unable to write file '%(filePath)s'.\n\nDetails: %(error)s") % 
                     {'filePath': self.cmdFileProtocol, 'error': e})
         finally:

Modified: grass/branches/releasebranch_7_0/gui/wxpython/gui_core/gselect.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gui_core/gselect.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gui_core/gselect.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -53,7 +53,7 @@
 from   grass.script import task as gtask
 try:
     from grass.pygrass import messages
-except ImportError, e:
+except ImportError as e:
     print >> sys.stderr, _("Unable to import pyGRASS: %s\n"
                            "Some functionality will be not accessible") % e
 
@@ -511,7 +511,7 @@
                     elem_list = filesdict[mapset]
                     self._addItems(elist = elem_list, elements = elements,
                                    mapset = mapset, exclude = exclude, node = node)
-            except StandardError, e:
+            except StandardError as e:
                 sys.stderr.write(_("GSelect: invalid item: %s") % e)
                 continue
             
@@ -690,7 +690,7 @@
                 import grass.temporal as tgis
                 try:
                     tgis.init(True)
-                except messages.FatalError, e:
+                except messages.FatalError as e:
                     sys.stderr.write("Temporal GIS error:\n%s" % e)
                     self.tgis_error = True
         if 'mapsets' in kargs:

Modified: grass/branches/releasebranch_7_0/gui/wxpython/gui_core/prompt.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gui_core/prompt.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gui_core/prompt.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -451,7 +451,7 @@
                             if command.find(self.toComplete['cmd']) == 0:
                                 dotNumber = list(self.toComplete['cmd']).count('.') 
                                 self.autoCompList.append(command.split('.',dotNumber)[-1])
-                        except UnicodeDecodeError, e: # TODO: fix it
+                        except UnicodeDecodeError as e: # TODO: fix it
                             sys.stderr.write(DecodeString(command) + ": " + unicode(e))
                             
             except (KeyError, TypeError):

Modified: grass/branches/releasebranch_7_0/gui/wxpython/gui_core/simplelmgr.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gui_core/simplelmgr.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gui_core/simplelmgr.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -313,7 +313,7 @@
 
                     layer.name = mapName
                     signal.emit(index=self._layerList.GetLayerIndex(layer), layer=layer)
-                except ValueError, e:
+                except ValueError as e:
                     self._layerList.RemoveLayer(layer)
                     GError(parent=self,
                            message=str(e),

Modified: grass/branches/releasebranch_7_0/gui/wxpython/iclass/frame.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/iclass/frame.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/iclass/frame.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -34,7 +34,7 @@
     from grass.lib.vector import *
     haveIClass = True
     errMsg = ''
-except ImportError, e:
+except ImportError as e:
     haveIClass = False
     errMsg = _("Loading imagery lib failed.\n%s") % e
 

Modified: grass/branches/releasebranch_7_0/gui/wxpython/iclass/statistics.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/iclass/statistics.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/iclass/statistics.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -25,7 +25,7 @@
 
 try:
     from grass.lib.imagery import *
-except ImportError, e:
+except ImportError as e:
     sys.stderr.write(_("Loading imagery lib failed"))
 
 from grass.pydispatch.signal import Signal

Modified: grass/branches/releasebranch_7_0/gui/wxpython/icons/icon.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/icons/icon.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/icons/icon.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -47,7 +47,7 @@
             iconSet[key] = img
         
         iconSet[key] = os.path.join(iconPath, iconSet[key])
-except StandardError, e:
+except StandardError as e:
     sys.exit(_("Unable to load icon theme. Reason: %s. Quiting wxGUI...") % e)
     
 class MetaIcon:

Modified: grass/branches/releasebranch_7_0/gui/wxpython/iscatt/core_c.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/iscatt/core_c.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/iscatt/core_c.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -19,7 +19,7 @@
 try:
     from grass.lib.imagery import *
     from grass.lib.gis import Cell_head, G_get_window
-except ImportError, e:
+except ImportError as e:
     sys.stderr.write(_("Loading ctypes libs failed"))
 
 from core.gcmd import GException

Modified: grass/branches/releasebranch_7_0/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/lmgr/frame.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/lmgr/frame.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -1169,7 +1169,7 @@
         # parse workspace file
         try:
             gxwXml = ProcessWorkspaceFile(etree.parse(filename))
-        except Exception, e:
+        except Exception as e:
             GError(parent = self,
                    message = _("Reading workspace file <%s> failed.\n"
                                "Invalid file, unable to parse XML document.") % filename)
@@ -1380,7 +1380,7 @@
         tmpfile = tempfile.TemporaryFile(mode = 'w+b')
         try:
             WriteWorkspaceFile(lmgr = self, file = tmpfile)
-        except StandardError, e:
+        except StandardError as e:
             GError(parent = self,
                    message = _("Writing current settings to workspace file "
                                "failed."))

Modified: grass/branches/releasebranch_7_0/gui/wxpython/location_wizard/dialogs.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/location_wizard/dialogs.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/location_wizard/dialogs.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -432,7 +432,7 @@
 
             self.__UpdateInfo()
 
-        except ValueError, e:
+        except ValueError as e:
             if len(event.GetString()) > 0 and event.GetString() != '-':
                 dlg = wx.MessageBox(parent = self,
                                     message = _("Invalid value: %s") % e,

Modified: grass/branches/releasebranch_7_0/gui/wxpython/location_wizard/wizard.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/location_wizard/wizard.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/location_wizard/wizard.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -533,7 +533,7 @@
             
             self.SendSizeEvent()
             
-        except StandardError, e:
+        except StandardError as e:
             wx.MessageBox(parent = self,
                           message = _("Unable to read list: %s") % e,
                           caption = _("Error"), style = wx.OK | wx.ICON_ERROR)
@@ -2136,7 +2136,7 @@
                                       wkt = self.wktpage.wktfile,
                                       desc = self.startpage.locTitle)
         
-        except grass.ScriptError, e:
+        except grass.ScriptError as e:
             return e.value
         
         return None

Modified: grass/branches/releasebranch_7_0/gui/wxpython/mapdisp/main.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/mapdisp/main.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/mapdisp/main.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -179,7 +179,7 @@
 
             self.SetLayers(reorderedLayers)
 
-        except IOError, e:
+        except IOError as e:
             grass.warning(_("Unable to read cmdfile '%(cmd)s'. Details: %(det)s") % \
                               { 'cmd' : self.cmdfile, 'det' : e })
             return
@@ -401,7 +401,7 @@
                 self.cmdTimeStamp = currentCmdFileTime
                 self.mapFrm.GetMap().GetLayersFromCmdFile()
                 self.timer.Start(mtime)
-        except OSError, e:
+        except OSError as e:
             grass.warning("%s" % e)
             self.timer.Stop()
 

Modified: grass/branches/releasebranch_7_0/gui/wxpython/mapdisp/statusbar.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/mapdisp/statusbar.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/mapdisp/statusbar.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -701,7 +701,7 @@
                 self.SetValue("%.*f; %.*f" % \
                                (precision, region['center_easting'],
                                 precision, region['center_northing']))
-        except SbException, e:
+        except SbException as e:
             # FIXME: this may be useless since statusbar update checks user defined projection and this exception raises when user def proj does not exists
             self.statusbar.SetStatusText(str(e), 0)
 
@@ -750,7 +750,7 @@
         try:
             self.SetCenter()
             self.Show()
-        except SbException, e:
+        except SbException as e:
             self.statusbar.SetStatusText(str(e), 0)
                         
         # disable long help
@@ -890,10 +890,10 @@
             else:
                 value = self._basicValue
             self.SetValue(value)
-        except SbException, e:
+        except SbException as e:
             self.SetValue(e.message)
         # TODO: remove these excepts, they just hide errors, solve problems differently
-        except TypeError, e:
+        except TypeError as e:
             self.SetValue("")
         except AttributeError:
             self.SetValue("") # during initialization MapFrame has no MapWindow
@@ -959,7 +959,7 @@
         try:
             regionReprojected = self.ReprojectRegionFromMap(region, projection, precision, format)
             self.SetValue(regionReprojected)
-        except SbException, e:
+        except SbException as e:
             self.SetValue(e.message)
         SbTextItem.Show(self)
     

Modified: grass/branches/releasebranch_7_0/gui/wxpython/mapwin/analysis.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/mapwin/analysis.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/mapwin/analysis.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -246,7 +246,7 @@
                 import grass.lib.gis as gislib
                 gislib.G_begin_distance_calculations()
                 self._useCtypes = True
-            except ImportError, e:
+            except ImportError as e:
                 self._giface.WriteWarning(_('Geodesic distance calculation '
                                             'is not available.\n'
                                             'Reason: %s' % e))

Modified: grass/branches/releasebranch_7_0/gui/wxpython/mapwin/buffered.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/mapwin/buffered.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/mapwin/buffered.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -495,7 +495,7 @@
                 try:
                     gcdc = wx.GCDC(dc)
                     self.pdcVector.DrawToDCClipped(gcdc, rgn)
-                except NotImplementedError, e:
+                except NotImplementedError as e:
                     print >> sys.stderr, e
                     self.pdcVector.DrawToDCClipped(dc, rgn)
             
@@ -510,7 +510,7 @@
                     try:
                         gcdc = wx.GCDC(dc)
                         self.pdcVector.DrawToDC(gcdc)
-                    except NotImplementedError, e:
+                    except NotImplementedError as e:
                         print >> sys.stderr, e
                         self.pdcVector.DrawToDC(dc)
                 
@@ -525,7 +525,7 @@
         try:
             gcdc = wx.GCDC(dc)
             self.pdcDec.DrawToDC(gcdc)
-        except NotImplementedError, e:
+        except NotImplementedError as e:
             print >> sys.stderr, e
             self.pdcDec.DrawToDC(dc)
         
@@ -800,7 +800,7 @@
             else:
                 self.mapfile = self.Map.Render(force = False)
             
-        except GException, e:
+        except GException as e:
             GError(message = e.value)
             self.mapfile = None
         

Modified: grass/branches/releasebranch_7_0/gui/wxpython/modules/colorrules.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/modules/colorrules.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/modules/colorrules.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -286,7 +286,7 @@
                 if self.attributeType == 'color':
                     try:
                         r, g, b = map(int, self.ruleslines[item][self.attributeType].split(':'))
-                    except ValueError, e:
+                    except ValueError as e:
                         message =  _("Bad color format. Use color format '0:0:0'")
                     self.mainPanel.FindWindowById(item + 2000).SetValue((r, g, b))
                 else:

Modified: grass/branches/releasebranch_7_0/gui/wxpython/modules/extensions.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/modules/extensions.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/modules/extensions.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -191,7 +191,7 @@
         self.SetStatusText(_("Fetching list of modules from GRASS-Addons SVN (be patient)..."), 0)
         try:
             self.modelBuilder.Load(url = self.repo.GetValue().strip())
-        except GException, e:
+        except GException as e:
             GError(unicode(e), parent = self, showTraceback = False)
         
         self.tree.RefreshItems()

Modified: grass/branches/releasebranch_7_0/gui/wxpython/nviz/main.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/nviz/main.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/nviz/main.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -26,7 +26,7 @@
     from nviz import workspace
     import wxnviz
     haveNviz = True
-except (ImportError, NameError), err:
+except (ImportError, NameError) as err:
     haveNviz = False
     errorMsg = err
 

Modified: grass/branches/releasebranch_7_0/gui/wxpython/nviz/mapwindow.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/nviz/mapwindow.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/nviz/mapwindow.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -1348,7 +1348,7 @@
                     if vInfo['map3d'] and (vInfo['kernels'] + vInfo['faces']) > 0:
                         self.LoadVector(item, points=None)
                     
-            except GException, e:
+            except GException as e:
                 GError(parent = self,
                        message = e.value)
         
@@ -1390,7 +1390,7 @@
                     if (vInfo['lines'] + vInfo['boundaries']) > 0 or vInfo['map3d']:
                         self.UnloadVector(layer, points = False)
                         
-            except GException, e:
+            except GException as e:
                 GError(parent = self,
                        message = e.value)
         

Modified: grass/branches/releasebranch_7_0/gui/wxpython/nviz/tools.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/nviz/tools.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/nviz/tools.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -2778,7 +2778,7 @@
         name = event.GetString()
         try:
             data = self._getLayerPropertiesByName(name, mapType = 'raster')['surface']
-        except TypeError, e:
+        except TypeError as e:
             self.EnablePage('surface', False)
             return
 

Modified: grass/branches/releasebranch_7_0/gui/wxpython/psmap/dialogs.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/psmap/dialogs.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/psmap/dialogs.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -4315,7 +4315,7 @@
                     import types
                     pImg.load = types.MethodType(loadPSForWindows, pImg)
                 img = PilImageToWxImage(pImg)
-            except IOError, e:
+            except IOError as e:
                 GError(message = _("Unable to read file %s") % file)
                 self.ClearPreview()
                 return

Modified: grass/branches/releasebranch_7_0/gui/wxpython/psmap/frame.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/psmap/frame.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/psmap/frame.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -323,7 +323,7 @@
                                                                                         'code': ret})
                 else:
                     self.SetStatusText(_('PDF generated'), 0)
-            except OSError, e:
+            except OSError as e:
                 GError(parent = self,
                        message = _("Program ps2pdf is not available. Please install it to create PDF.\n\n %s") % e)
 
@@ -346,7 +346,7 @@
                     import types
                     im.load = types.MethodType(loadPSForWindows, im)
                 im.save(self.imgName, format = 'PNG')
-            except IOError, e:
+            except IOError as e:
                 del busy
                 dlg = HyperlinkDialog(self, title=_("Preview not available"),
                                       message=_("Preview is not available probably due to missing Ghostscript."),

Modified: grass/branches/releasebranch_7_0/gui/wxpython/psmap/instructions.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/psmap/instructions.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/psmap/instructions.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -468,7 +468,7 @@
         try:
             RunCommand(cmd[0], **cmd[1])
             
-        except grass.ScriptError, e:
+        except grass.ScriptError as e:
             GError(_("Region cannot be set\n%s") % e)
             return False
         
@@ -809,7 +809,7 @@
         instr += "    end"
         try:
             instr = instr.encode('latin1')
-        except UnicodeEncodeError, err:
+        except UnicodeEncodeError as err:
             try:
                 pos = str(err).split('position')[1].split(':')[0].strip()
             except IndexError:
@@ -1542,7 +1542,7 @@
             return False
         try:
             info = grass.find_file(map, element = 'cell')
-        except grass.ScriptError, e:
+        except grass.ScriptError as e:
             GError(message = e.value)
             return False
         instr['raster'] = info['fullname']
@@ -1580,7 +1580,7 @@
                 vmap = line.split()[1]
                 try:
                     info = grass.find_file(vmap, element = 'vector')
-                except grass.ScriptError, e:
+                except grass.ScriptError as e:
                     GError(message = e.value)
                     return False
                 vmap = info['fullname']
@@ -1691,7 +1691,7 @@
         vInstruction += "    end"
         try:
             vInstruction = vInstruction.encode('Latin_1')
-        except UnicodeEncodeError, err:
+        except UnicodeEncodeError as err:
             try:
                 pos = str(err).split('position')[1].split(':')[0].strip()
             except IndexError:
@@ -1713,7 +1713,7 @@
         instr = {}
         try:
             info = grass.find_file(name = text[0].split()[1], element = 'vector')
-        except grass.ScriptError, e:
+        except grass.ScriptError as e:
             GError(message = e.value)
             return False
         instr['name'] = info['fullname']

Modified: grass/branches/releasebranch_7_0/gui/wxpython/timeline/g.gui.timeline.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/timeline/g.gui.timeline.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/timeline/g.gui.timeline.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -45,7 +45,7 @@
 def main():
     try:
         from timeline.frame import TimelineFrame
-    except ImportError, e:
+    except ImportError as e:
         grass.fatal(e.message)
 
     datasets = options['inputs'].strip().split(',')

Modified: grass/branches/releasebranch_7_0/gui/wxpython/tools/update_menudata.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/tools/update_menudata.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/tools/update_menudata.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -53,7 +53,7 @@
             continue
         try:
             interface = gtask.parse_interface(module)
-        except Exception, e:
+        except Exception as e:
             grass.error(module + ': ' + str(e))
             continue
         modules[interface.name] = { 'label'   : interface.label,

Modified: grass/branches/releasebranch_7_0/gui/wxpython/vdigit/main.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/vdigit/main.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/vdigit/main.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -18,7 +18,7 @@
     from vdigit.wxdigit import IVDigit, GV_LINES, CFUNCTYPE
     haveVDigit = True
     errorMsg   = ''
-except (ImportError, NameError), err:
+except (ImportError, NameError) as err:
     haveVDigit = False
     errorMsg   = err
     GV_LINES   = -1

Modified: grass/branches/releasebranch_7_0/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/wxgui.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/wxgui.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -118,10 +118,10 @@
         try:
             opts, args = getopt.getopt(argv[1:], "hw:",
                                        ["help", "workspace"])
-        except getopt.error, msg:
+        except getopt.error as msg:
             raise Usage(msg)
     
-    except Usage, err:
+    except Usage as err:
         print >> sys.stderr, err.msg
         print >> sys.stderr, "for help use --help"
         printHelp()

Modified: grass/branches/releasebranch_7_0/gui/wxpython/wxplot/base.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/wxplot/base.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/wxplot/base.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -21,7 +21,7 @@
 import wx
 try:
     import wx.lib.plot as plot
-except ImportError, e:
+except ImportError as e:
     print >> sys.stderr, e
 
 from core.globalvar    import ICONDIR

Modified: grass/branches/releasebranch_7_0/gui/wxpython/wxplot/histogram.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/wxplot/histogram.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/wxplot/histogram.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -20,7 +20,7 @@
 import wx
 try:
     import wx.lib.plot as plot
-except ImportError, e:
+except ImportError as e:
     print >> sys.stderr, e
 
 import grass.script as grass
@@ -182,7 +182,7 @@
                 datalist.append((cellval,histval))
 
             return datalist
-        except GException, e:
+        except GException as e:
             GError(parent = self,
                    message = e.value)
             return None

Modified: grass/branches/releasebranch_7_0/gui/wxpython/wxplot/profile.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/wxplot/profile.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/wxplot/profile.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -22,7 +22,7 @@
 import wx
 try:
     import wx.lib.plot as plot
-except ImportError, e:
+except ImportError as e:
     print >> sys.stderr, e
 
 import grass.script as grass
@@ -356,7 +356,7 @@
                 
                 try:
                     fd = open(pfile[-1], "w")
-                except IOError, e:
+                except IOError as e:
                     GError(parent = self,
                            message = _("Unable to open file <%s> for writing.\n"
                                        "Reason: %s") % (pfile[-1], e))

Modified: grass/branches/releasebranch_7_0/gui/wxpython/wxplot/scatter.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/wxplot/scatter.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/gui/wxpython/wxplot/scatter.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -20,7 +20,7 @@
 import wx
 try:
     import wx.lib.plot as plot
-except ImportError, e:
+except ImportError as e:
     print >> sys.stderr, e
 
 import grass.script as grass
@@ -188,7 +188,7 @@
                 datalist.append((rast1,rast2))
 
             return datalist
-        except GException, e:
+        except GException as e:
             GError(parent = self,
                    message = e.value)
             return None

Modified: grass/branches/releasebranch_7_0/lib/init/grass.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/init/grass.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/lib/init/grass.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -650,7 +650,7 @@
                             # create location using georeferenced file
                             grass.create_location(gisdbase, location_name,
                                                   filename=geofile)
-                    except grass.ScriptError, e:
+                    except grass.ScriptError as e:
                         fatal(e.value.strip('"').strip("'").replace('\\n',
                                                                    os.linesep))
                 else:
@@ -812,7 +812,7 @@
     
     try:
         locale.setlocale(locale.LC_ALL, language)
-    except locale.Error, e:
+    except locale.Error as e:
         try:
             # Locale lang.encoding might be missing. Let's try
             # UTF-8 encoding before giving up as on Linux systems
@@ -820,12 +820,12 @@
             # ISO-8859 ones.
             language = locale.normalize('%s.UTF-8' % (language))
             locale.setlocale(locale.LC_ALL, language)
-        except locale.Error, e:
+        except locale.Error as e:
             # The last attempt...
             try:
                 language = locale.normalize('%s.%s' % (language, locale.getpreferredencoding()))
                 locale.setlocale(locale.LC_ALL, language)
-            except locale.Error, e:
+            except locale.Error as e:
                 # If we got so far, attempts to set up language and locale have failed
                 # on this system
                 sys.stderr.write("Failed to enforce user specified language '%s' with error: '%s'\n" % (language, e))

Modified: grass/branches/releasebranch_7_0/lib/python/ctypes/ctypesgencore/libraryloader.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/ctypes/ctypesgencore/libraryloader.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/lib/python/ctypes/ctypesgencore/libraryloader.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -67,7 +67,7 @@
                 return ctypes.CDLL(path, ctypes.RTLD_GLOBAL)
             else:
                 return ctypes.cdll.LoadLibrary(path)
-        except OSError,e:
+        except OSError as e:
             raise ImportError,e
     
     def getpaths(self,libname):

Modified: grass/branches/releasebranch_7_0/lib/python/ctypes/ctypesgencore/parser/lex.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/ctypes/ctypesgencore/parser/lex.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/lib/python/ctypes/ctypesgencore/parser/lex.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -455,7 +455,7 @@
                     lexindexfunc[i] = (None, f[2:])
          
         return [(lexre,lexindexfunc)],[regex]
-    except Exception,e:
+    except Exception as e:
         m = int(len(relist)/2)
         if m == 0: m = 1
         llist, lre = _form_master_re(relist[:m],reflags,ldict)
@@ -702,7 +702,7 @@
                              print "%s:%d: Regular expression for rule '%s' matches empty string." % (file,line,f.__name__)
                              error = 1
                              continue
-                    except re.error,e:
+                    except re.error as e:
                         print "%s:%d: Invalid regular expression for rule '%s'. %s" % (file,line,f.__name__,e)
                         if '#' in f.__doc__:
                              print "%s:%d. Make sure '#' in rule '%s' is escaped with '\\#'." % (file,line, f.__name__)                 
@@ -743,7 +743,7 @@
                          print "lex: Regular expression for rule '%s' matches empty string." % name
                          error = 1
                          continue
-                except re.error,e:
+                except re.error as e:
                     print "lex: Invalid regular expression for rule '%s'. %s" % (name,e)
                     if '#' in r:
                          print "lex: Make sure '#' in rule '%s' is escaped with '\\#'." % name

Modified: grass/branches/releasebranch_7_0/lib/python/ctypes/ctypesgencore/parser/pplexer.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/ctypes/ctypesgencore/parser/pplexer.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/lib/python/ctypes/ctypesgencore/parser/pplexer.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -59,12 +59,12 @@
         # Unescaping probably not perfect but close enough.
         try:
             value = value[1:-1].decode('string_escape')
-        except ValueError, e:
+        except ValueError as e:
             try:
                 value = re.sub(r'\\x([0-9a-fA-F])(?![0-9a-fA-F])',
                                r'\x0\1',
                                value[1:-1]).decode('string_escape')
-            except ValueError, e:
+            except ValueError as e:
                 raise ValueError("invalid \\x escape in %s" % value)
         return str.__new__(cls, value)
 

Modified: grass/branches/releasebranch_7_0/lib/python/ctypes/ctypesgencore/parser/yacc.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/ctypes/ctypesgencore/parser/yacc.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/lib/python/ctypes/ctypesgencore/parser/yacc.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -615,7 +615,7 @@
         # Precompute list of productions immediately following
         try:
             p.lrafter = Prodnames[p.prod[n+1]]
-        except (IndexError,KeyError),e:
+        except (IndexError,KeyError) as e:
             p.lrafter = []
         try:
             p.lrbefore = p.prod[n-1]
@@ -1785,7 +1785,7 @@
                                 action[st,a] = j
                                 actionp[st,a] = p
                                 
-            except StandardError,e:
+            except StandardError as e:
                 raise YaccError, "Hosed in lr_parse_table", e
 
         # Print the actions associated with each terminal
@@ -1948,7 +1948,7 @@
         
         f.close()
 
-    except IOError,e:
+    except IOError as e:
         print "Unable to create '%s'" % filename
         print e
         return
@@ -2194,7 +2194,7 @@
                     f.write("\n\n")
                     f.write(_vf.getvalue())
                     f.close()
-                except IOError,e:
+                except IOError as e:
                     print "yacc: can't create '%s'" % debugfile,e
         
     # Made it here.   Create a parser object and set up its internal state.

Modified: grass/branches/releasebranch_7_0/lib/python/ctypes/ctypesgencore/processor/operations.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/ctypes/ctypesgencore/processor/operations.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/lib/python/ctypes/ctypesgencore/processor/operations.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -189,7 +189,7 @@
     for library_name in opts.libraries:
         try:
             library=ctypesgencore.libraryloader.load_library(library_name)
-        except ImportError,e:
+        except ImportError as e:
             warning_message("Could not load library \"%s\". Okay, I'll " \
                 "try to load it at runtime instead. " % (library_name),
                 cls = 'missing-library')

Modified: grass/branches/releasebranch_7_0/lib/python/ctypes/loader.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/ctypes/loader.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/lib/python/ctypes/loader.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -67,7 +67,7 @@
                 return ctypes.CDLL(path, ctypes.RTLD_GLOBAL)
             else:
                 return ctypes.cdll.LoadLibrary(path)
-        except OSError,e:
+        except OSError as e:
             raise ImportError,e
     
     def getpaths(self,libname):

Modified: grass/branches/releasebranch_7_0/lib/python/pydispatch/robust.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/pydispatch/robust.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/lib/python/pydispatch/robust.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -50,7 +50,7 @@
 				*arguments,
 				**named
 			)
-		except Exception, err:
+		except Exception as err:
 			responses.append((receiver, err))
 		else:
 			responses.append((receiver, response))

Modified: grass/branches/releasebranch_7_0/lib/python/pydispatch/saferef.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/pydispatch/saferef.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/lib/python/pydispatch/saferef.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -115,7 +115,7 @@
 				try:
 					if hasattr(function, '__call__' ):
 						function( self )
-				except Exception, e:
+				except Exception as e:
 					try:
 						traceback.print_exc()
 					except AttributeError:

Modified: grass/branches/releasebranch_7_0/lib/python/script/core.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/script/core.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/lib/python/script/core.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -1602,7 +1602,7 @@
         else:
             fd.write(os.linesep)
         fd.close()
-    except OSError, e:
+    except OSError as e:
         raise ScriptError(repr(e))
 
 
@@ -1650,7 +1650,7 @@
                     os.path.join(location, "PERMANENT", "WIND"))
 
         os.chdir(cur_dir)
-    except OSError, e:
+    except OSError as e:
         raise ScriptError(repr(e))
 
 # interface to g.version

Modified: grass/branches/releasebranch_7_0/lib/python/script/task.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/script/task.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/lib/python/script/task.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -66,7 +66,7 @@
             try:
                 processTask(tree = etree.fromstring(get_interface_description(path)),
                             task = self)
-            except ScriptError, e:
+            except ScriptError as e:
                 self.errorMsg = e.value
             
             self.define_first()
@@ -486,7 +486,7 @@
             raise ScriptError, _("Unable to fetch interface description for command '%(cmd)s'."
                                  "\n\nDetails: %(det)s") % { 'cmd' : cmd, 'det' : decode(cmderr) }
     
-    except OSError, e:
+    except OSError as e:
         raise ScriptError, _("Unable to fetch interface description for command '%(cmd)s'."
                              "\n\nDetails: %(det)s") % { 'cmd' : cmd, 'det' : e }
     

Modified: grass/branches/releasebranch_7_0/lib/python/temporal/gui_support.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/temporal/gui_support.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/lib/python/temporal/gui_support.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -46,7 +46,7 @@
     for type in types:
         try:
             tlist_result = tlist(type=type, dbif=dbif)
-        except core.ScriptError, e:
+        except core.ScriptError as e:
             warning(e)
             continue
 

Modified: grass/branches/releasebranch_7_0/man/build_html.py
===================================================================
--- grass/branches/releasebranch_7_0/man/build_html.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/man/build_html.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -302,7 +302,7 @@
 def try_mkdir(path):
     try:
         os.mkdir(path)
-    except OSError, e:
+    except OSError as e:
         pass
 
 def replace_file(name):
@@ -312,7 +312,7 @@
     else:
         try:
             os.remove(name)
-        except OSError, e:
+        except OSError as e:
             pass
         os.rename(temp, name)
 

Modified: grass/branches/releasebranch_7_0/man/build_rest.py
===================================================================
--- grass/branches/releasebranch_7_0/man/build_rest.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/man/build_rest.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -278,7 +278,7 @@
 def try_mkdir(path):
     try:
         os.mkdir(path)
-    except OSError, e:
+    except OSError as e:
         pass
 
 def replace_file(name):
@@ -288,7 +288,7 @@
     else:
         try:
             os.remove(name)
-        except OSError, e:
+        except OSError as e:
             pass
         os.rename(temp, name)
 

Modified: grass/branches/releasebranch_7_0/scripts/d.redraw/d.redraw.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/d.redraw/d.redraw.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/scripts/d.redraw/d.redraw.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -51,7 +51,7 @@
         
         for cmd in cmdList:
             grass.call(split(cmd))
-    except IOError, e:
+    except IOError as e:
         grass.fatal(_("Unable to open file '%s' for reading. Details: %s") % \
                         (monCmd, e))
     
@@ -61,7 +61,7 @@
     try:
         fd = open(monCmd, "w")
         fd.writelines(cmdList)
-    except IOError, e:
+    except IOError as e:
         grass.fatal(_("Unable to open file '%s' for writing. Details: %s") % \
                         (monCmd, e))
     

Modified: grass/branches/releasebranch_7_0/scripts/g.extension/g.extension.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/g.extension/g.extension.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/scripts/g.extension/g.extension.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -935,7 +935,7 @@
 
     try:
         shutil.copyfile(dist_file, addons_file)
-    except OSError, e:
+    except OSError as e:
         grass.fatal(_("Unable to create '%s': %s") % (addons_file, e))
 
 def create_dir(path):
@@ -944,7 +944,7 @@
 
     try:
         os.makedirs(path)
-    except OSError, e:
+    except OSError as e:
         grass.fatal(_("Unable to create '%s': %s") % (path, e))
 
     grass.debug("'%s' created" % path)
@@ -970,7 +970,7 @@
     try:
         f = open(htmlfile)
         shtml = f.read()
-    except IOError, e:
+    except IOError as e:
         grass.fatal(_("Unable to read manual page: %s") % e)
     else:
         f.close()
@@ -1000,7 +1000,7 @@
     try:
         f = open(htmlfile, 'w')
         f.write(ohtml)
-    except IOError, e:
+    except IOError as e:
         grass.fatal(_("Unable for write manual page: %s") % e)
     else:
         f.close()

Modified: grass/branches/releasebranch_7_0/scripts/g.extension.all/g.extension.all.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/g.extension.all/g.extension.all.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/scripts/g.extension.all/g.extension.all.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -58,7 +58,7 @@
     fo = open(fXML, 'r')
     try:
         tree = etree.fromstring(fo.read())
-    except StandardError, e:
+    except StandardError as e:
         grass.error(_("Unable to parse metadata file: %s") % e)
         fo.close()
         return []

Modified: grass/branches/releasebranch_7_0/scripts/r.in.wms/wms_base.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/r.in.wms/wms_base.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/scripts/r.in.wms/wms_base.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -219,7 +219,7 @@
 
         try:
             cap = self._fetchDataFromServer(cap_url, options['username'], options['password'])
-        except (IOError, HTTPException), e:
+        except (IOError, HTTPException) as e:
             if urllib2.HTTPError == type(e) and e.code == 401:
                 grass.fatal(_("Authorization failed to <%s> when fetching capabilities") % options['url'])
             else:
@@ -380,7 +380,7 @@
                                       '-r', gdal_method,
                                       self.temp_map, self.temp_warpmap], stdout = nuldev)
                 ps.wait()
-            except OSError, e:
+            except OSError as e:
                 grass.fatal('%s \nThis can be caused by missing %s utility. ' % (e, 'gdalwarp'))
             
             if nuldev:

Modified: grass/branches/releasebranch_7_0/scripts/r.in.wms/wms_drv.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/r.in.wms/wms_drv.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/scripts/r.in.wms/wms_drv.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -95,7 +95,7 @@
             grass.debug(query_url, 2)
             try: 
                 wms_data = self._fetchDataFromServer(query_url, self.params['username'], self.params['password'])
-            except (IOError, HTTPException), e:
+            except (IOError, HTTPException) as e:
                 if HTTPError == type(e) and e.code == 401:
                     grass.fatal(_("Authorization failed to '%s' when fetching data.\n%s") % (self.params['url'], str(e)))
                 else:
@@ -107,7 +107,7 @@
             try:
                 temp_tile_opened = open(temp_tile, 'wb')
                 temp_tile_opened.write(wms_data.read())
-            except IOError, e:
+            except IOError as e:
                 # some servers are not happy with many subsequent requests for tiles done immediately,
                 # if immediate request was unsuccessful, try to repeat the request after 5s and 30s breaks
                 # TODO probably servers can return more kinds of errors related to this problem (not only 104)
@@ -136,7 +136,7 @@
                 try:
                     error_xml_opened = open(temp_tile, 'rb')
                     err_str = error_xml_opened.read()     
-                except IOError, e:
+                except IOError as e:
                     grass.fatal(_("Unable to read data from tempfile.\n%s") % str(e))
                 finally:
                     error_xml_opened.close()

Modified: grass/branches/releasebranch_7_0/scripts/r.pack/r.pack.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/r.pack/r.pack.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/scripts/r.pack/r.pack.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -111,7 +111,7 @@
     tar.close()
     try:
         shutil.move(outfile_base, outfile)
-    except shutil.Error, e:
+    except shutil.Error as e:
         grass.fatal(e)
         
     os.chdir(olddir)

Modified: grass/branches/releasebranch_7_0/scripts/v.krige/v.krige.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/v.krige/v.krige.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/scripts/v.krige/v.krige.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -349,7 +349,7 @@
         if options['model'] is '':
             try:
                 robjects.r.require("automap")
-            except ImportError, e:
+            except ImportError as e:
                 grass.fatal(_("R package automap is missing, no variogram autofit available."))
         else:
             if options['sill'] is '' or options['nugget'] is '' or options['range'] is '':

Modified: grass/branches/releasebranch_7_0/temporal/t.register/t.register.py
===================================================================
--- grass/branches/releasebranch_7_0/temporal/t.register/t.register.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/temporal/t.register/t.register.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -127,5 +127,5 @@
 
     try:
         tgis.profile_function(main)
-    except StandardError, e:
+    except StandardError as e:
         grass.fatal(e)

Modified: grass/branches/releasebranch_7_0/tools/g.html2man/g.html2man.py
===================================================================
--- grass/branches/releasebranch_7_0/tools/g.html2man/g.html2man.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/tools/g.html2man/g.html2man.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -34,10 +34,10 @@
     for n, line in enumerate(inf):
 	try:
 	    p.feed(line)
-	except HTMLParseError, err:
+	except HTMLParseError as err:
 	    sys.stderr.write('%s:%d:%d: Parse error: %s\n' % (infile, err.lineno, err.offset, err.msg))
 	    sys.exit(1)
-	except Exception, err:
+	except Exception as err:
 	    sys.stderr.write('%s:%d:0: Error (%s): %s\n' % (infile, n + 1, repr(err), line))
 	    sys.exit(1)
     p.close()

Modified: grass/branches/releasebranch_7_0/tools/reindent.py
===================================================================
--- grass/branches/releasebranch_7_0/tools/reindent.py	2014-05-13 04:15:54 UTC (rev 60216)
+++ grass/branches/releasebranch_7_0/tools/reindent.py	2014-05-13 05:11:15 UTC (rev 60217)
@@ -70,7 +70,7 @@
     try:
         opts, args = getopt.getopt(sys.argv[1:], "drnvh",
                         ["dryrun", "recurse", "nobackup", "verbose", "help"])
-    except getopt.error, msg:
+    except getopt.error as msg:
         usage(msg)
         return
     for o, a in opts:
@@ -111,7 +111,7 @@
         print "checking", file, "...",
     try:
         f = open(file)
-    except IOError, msg:
+    except IOError as msg:
         errprint("%s: I/O Error: %s" % (file, str(msg)))
         return
 



More information about the grass-commit mailing list