diff --git a/SConstruct b/SConstruct
index c0881ea4eb54743c533cd93fbff56ffa8cc2920b..d58140349a8ba327ae8c2a5ba5bf9c57dc29966a 100644
--- a/SConstruct
+++ b/SConstruct
@@ -29,9 +29,10 @@ else:
 
 env = Environment(ENV = os.environ)
 
-# TODO: detect SWIG
-#if *** not swig ***:
-if False:
+# detect SWIG
+try:
+    env['SWIG']
+except KeyError:
     print """
 Error: SWIG not found.
 Please install SWIG, as we need it to create the python wrapper.