浏览代码

don't trust the system to close the file for us on error

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@40353 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman 15 年之前
父节点
当前提交
224a7f5072
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scripts/v.in.lines/v.in.lines.py

+ 1 - 1
scripts/v.in.lines/v.in.lines.py

@@ -135,9 +135,9 @@ def main():
             continue
         numcols = len(line.split())
         break
+    inf.close()
     if (do3D and numcols < 3) or (not do3D and numcols < 2):
         grass.fatal(_("Not enough data columns. (incorrect fs setting?)"))
-    inf.close()
 
 
     grass.run_command('v.in.mapgen', flags = 'f' + do3D,