summary refs log tree commit diff stats
path: root/lib/pure/dynlib.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pure/dynlib.nim')
-rw-r--r--lib/pure/dynlib.nim5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/pure/dynlib.nim b/lib/pure/dynlib.nim
index d030ad532..97bc51bc5 100644
--- a/lib/pure/dynlib.nim
+++ b/lib/pure/dynlib.nim
@@ -72,10 +72,7 @@ proc unloadLib*(lib: LibHandle) {.gcsafe.}
 
 proc raiseInvalidLibrary*(name: cstring) {.noinline, noreturn.} =
   ## raises an `EInvalidLibrary` exception.
-  var e: ref LibraryError
-  new(e)
-  e.msg = "could not find symbol: " & $name
-  raise e
+  raise newException(LibraryError, "could not find symbol: " & $name)
 
 proc symAddr*(lib: LibHandle, name: cstring): pointer {.gcsafe.}
   ## retrieves the address of a procedure/variable from `lib`. Returns nil