summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/common.py8
-rw-r--r--tests/testhelpermodule.c1
2 files changed, 7 insertions, 2 deletions
diff --git a/tests/common.py b/tests/common.py
index 9429579a..64fc6f42 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -41,6 +41,7 @@ def importModules(buildDir, srcDir):
def importModule(module, directory, name=None):
global isDistCheck
+ origName = module
if '.' in module:
fromlist = '.'.join(module.split('.')[:-1])
else:
@@ -49,7 +50,12 @@ def importModule(module, directory, name=None):
if not name:
name = module + '.la'
- obj = __import__(module, {}, {}, fromlist)
+ try:
+ obj = __import__(module, {}, {}, fromlist)
+ except ImportError:
+ print 'WARNING: %s could not be imported' % origName
+ return
+
if hasattr(obj, '__file__'):
location = obj.__file__
else:
diff --git a/tests/testhelpermodule.c b/tests/testhelpermodule.c
index 791fe543..cb9a9913 100644
--- a/tests/testhelpermodule.c
+++ b/tests/testhelpermodule.c
@@ -1,6 +1,5 @@
#include "pygobject.h"
#include <gobject/gmarshal.h>
-#include <gtk/gtk.h>
#include "test-thread.h"
#include "test-unknown.h"