[pygobject] Fix gtk-demo for Python 3



commit 2270cf15012005362dc47456213c5d9e7f6ed28a
Author: Martin Pitt <martinpitt gnome org>
Date:   Wed Jan 23 14:14:29 2013 +0100

    Fix gtk-demo for Python 3
    
    It was crashing with
    
       package = __import__(packagename, globals(), locals(), [modulename], -1)
      ValueError: level must be >= 0
    
    Using level zero works with both Python 2 and 3.

 demos/gtk-demo/gtk-demo.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/demos/gtk-demo/gtk-demo.py b/demos/gtk-demo/gtk-demo.py
index 13455ee..6de2e30 100755
--- a/demos/gtk-demo/gtk-demo.py
+++ b/demos/gtk-demo/gtk-demo.py
@@ -72,7 +72,7 @@ class Demo(GObject.GObject):
         packagename = os.path.dirname(relpath).replace(os.sep, '.')
         modulename = os.path.basename(relpath)[0:-3]
 
-        package = __import__(packagename, globals(), locals(), [modulename], -1)
+        package = __import__(packagename, globals(), locals(), [modulename], 0)
         module = getattr(package, modulename)
 
         try:



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