Fixed FD leak.
This commit is contained in:
parent
cdc81f3371
commit
36d09de320
1 changed files with 2 additions and 2 deletions
|
|
@ -118,6 +118,7 @@ proc readPackageInfoFromNimble(path: string; result: var PackageInfo) =
|
|||
if fs != nil:
|
||||
var p: CfgParser
|
||||
open(p, fs, path)
|
||||
defer: close(p)
|
||||
var currentSection = ""
|
||||
while true:
|
||||
var ev = next(p)
|
||||
|
|
@ -172,7 +173,6 @@ proc readPackageInfoFromNimble(path: string; result: var PackageInfo) =
|
|||
"Invalid package info, should not contain --" & ev.value)
|
||||
of cfgError:
|
||||
raise newException(NimbleError, "Error parsing .nimble file: " & ev.msg)
|
||||
close(p)
|
||||
else:
|
||||
raise newException(ValueError, "Cannot open package info: " & path)
|
||||
|
||||
|
|
@ -269,4 +269,4 @@ proc getInstalledPkgs*(libsDir: string, options: Options):
|
|||
raise exc
|
||||
|
||||
proc isNimScript*(nf: string, options: Options): bool =
|
||||
result = readPackageInfo(nf, options).isNimScript
|
||||
result = readPackageInfo(nf, options).isNimScript
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue