From fdd9f37131c2d36ea18eb075a808df2e872f0c77 Mon Sep 17 00:00:00 2001 From: Chuck Musser <cmusser@linktv.org> Date: Fri, 6 Jun 2014 10:15:39 -0700 Subject: [PATCH] Set initialized flag to true after loading library. --- src/nacl/_lib/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nacl/_lib/__init__.py b/src/nacl/_lib/__init__.py index d8f787ec..d30f16c5 100644 --- a/src/nacl/_lib/__init__.py +++ b/src/nacl/_lib/__init__.py @@ -62,7 +62,7 @@ class Library(object): def __init__(self, ffi): self.ffi = ffi - self._initalized = False + self._initialized = False # This prevents the compile_module() from being called, the module # should have been compiled by setup.py @@ -71,8 +71,9 @@ class Library(object): self.ffi.verifier.compile_module = _compile_module def __getattr__(self, name): - if not self._initalized: + if not self._initialized: self._lib = self.ffi.verifier.load_library() + self._initialized = True # redirect attribute access to the underlying lib attr = getattr(self._lib, name) -- GitLab