[GRASS-SVN] r66965 - grass/trunk/scripts/v.import

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


Author: martinl
Date: 2015-11-28 07:07:51 -0800 (Sat, 28 Nov 2015)
New Revision: 66965

Modified:
   grass/trunk/scripts/v.import/v.import.py
Log:
v.import: catch exception when unable to open datasource

Modified: grass/trunk/scripts/v.import/v.import.py
===================================================================
--- grass/trunk/scripts/v.import/v.import.py	2015-11-28 14:32:59 UTC (rev 66964)
+++ grass/trunk/scripts/v.import/v.import.py	2015-11-28 15:07:51 UTC (rev 66965)
@@ -109,7 +109,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