浏览代码

v.unpack: fix global var

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

+ 4 - 4
scripts/v.unpack/v.unpack.py

@@ -49,15 +49,15 @@ def cleanup():
 def main():
     infile = options['input']
     
-    # check if the input file exists
-    if not os.path.exists(infile):
-        grass.fatal(_("File <%s> not found") % infile)
-    
     # create temporary directory
     global tmp_dir
     tmp_dir = grass.tempdir()
     grass.debug('tmp_dir = %s' % tmp_dir)
     
+    # check if the input file exists
+    if not os.path.exists(infile):
+        grass.fatal(_("File <%s> not found") % infile)
+    
     # copy the files to tmp dir
     input_base = os.path.basename(infile)
     shutil.copyfile(infile, os.path.join(tmp_dir, input_base))