[pygobject/pygobject-2-28] Fix uninitialized variable in gi.require_version()



commit 2923f26c7850d12ece67b3ef96054721d38f888f
Author: Martin Pitt <martin pitt ubuntu com>
Date:   Wed Mar 2 16:29:00 2011 +0100

    Fix uninitialized variable in gi.require_version()

 gi/__init__.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gi/__init__.py b/gi/__init__.py
index ed20606..314d579 100644
--- a/gi/__init__.py
+++ b/gi/__init__.py
@@ -32,7 +32,8 @@ def require_version(namespace, version):
     repository = Repository.get_default()
 
     if namespace in repository.get_loaded_namespaces():
-        if repository.get_version(namespace) != version:
+        loaded_version = repository.get_version(namespace)
+        if loaded_version != version:
             raise ValueError('Namespace %s is already loaded with version %s' % \
                              (namespace, loaded_version))
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]