Explorar o código

pygrass: fix error message when path not found

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@67544 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa %!s(int64=9) %!d(string=hai) anos
pai
achega
f3ec8ba283
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      lib/python/pygrass/utils.py

+ 3 - 1
lib/python/pygrass/utils.py

@@ -328,7 +328,9 @@ def set_path(modulename, dirname=None, path='.'):
         # running from GRASS GIS session
         path = get_lib_path(modulename, dirname)
         if path is None:
-            raise ImportError("Not able to find the path %s directory." % path)
+            pathname = os.path.join(modulename, dirname) if dirname else modulename
+            raise ImportError("Not able to find the path '%s' directory "
+                              "(current dir '%s')." % (pathname, os.getcwd()))
         sys.path.append(path)