ソースを参照

grass.py: fix cleanup() when no location is defined

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54490 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 年 前
コミット
c334c2bb42
1 ファイル変更6 行追加3 行削除
  1. 6 3
      lib/init/grass.py

+ 6 - 3
lib/init/grass.py

@@ -106,9 +106,12 @@ def cleanup():
     tmpdir, lockfile, remove_lockfile
     # all exits after setting up tmp dirs (system/location) should
     # also tidy it up
-    for tmpd in [tmpdir, os.path.join(location, ".tmp")]:
-        cleanup_dir(tmpd)
-        try_rmdir(tmpd)
+    cleanup_dir(tmpdir)
+    try_rmdir(tmpdir)
+    if location:
+        tmpdir_loc = os.path.join(location, ".tmp")
+        cleanup_dir(tmpdir_loc)
+        try_rmdir(tmpdir_loc)
     
     # remove lock-file if requested
     if lockfile and remove_lockfile: