浏览代码

grass.py: fix cleanup - must be registered when tmpdir variable is initialized

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@65258 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 10 年之前
父节点
当前提交
0594efcba8
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      lib/init/grass.py

+ 1 - 2
lib/init/grass.py

@@ -1362,8 +1362,6 @@ if windows:
     if not os.getenv('SHELL'):
         os.environ['SHELL'] = os.getenv('COMSPEC', 'cmd.exe')
 
-atexit.register(cleanup, tmpdir)
-
 # Set default GUI
 default_gui = "wxpython"
 
@@ -1431,6 +1429,7 @@ set_language()
 
 # Create the temporary directory and session grassrc file
 tmpdir = create_tmp()
+atexit.register(cleanup, tmpdir)
 
 # Create the session grassrc file
 gisrc = create_gisrc(tmpdir, gisrcrc)