[GRASS-SVN] r66966 - grass/branches/releasebranch_7_0/scripts/v.import

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Nov 28 07:18:56 PST 2015


Author: martinl
Date: 2015-11-28 07:18:56 -0800 (Sat, 28 Nov 2015)
New Revision: 66966

Modified:
   grass/branches/releasebranch_7_0/scripts/v.import/v.import.py
Log:
v.import: catch exception when unable to open datasource
          (merge r66965 from trunk)


Modified: grass/branches/releasebranch_7_0/scripts/v.import/v.import.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/v.import/v.import.py	2015-11-28 15:07:51 UTC (rev 66965)
+++ grass/branches/releasebranch_7_0/scripts/v.import/v.import.py	2015-11-28 15:18:56 UTC (rev 66966)
@@ -106,7 +106,10 @@
 
     # list layers and exit
     if flags['l']:
-        grass.run_command('v.in.ogr', flags='l', input=options['input'])
+        try:
+            grass.run_command('v.in.ogr', flags='l', input=options['input'])
+        except CalledModuleError:
+            return 1
         return 0
 
     OGRdatasource = options['input']



More information about the grass-commit mailing list