def strtobool(x):
    try:
        b = x.lower() in ("true", "yes", "1", "y")
        return b
    except AttributeError:
        return False
    except NameError
        return False
def strtobool(x):
    return x.lower() in ("true", "yes", "1", "y")
--- 
+++ 
@@ -1,2 +1,8 @@
 def strtobool(x):
-    return x.lower() in ("true", "yes", "1", "y")
+    try:
+        b = x.lower() in ("true", "yes", "1", "y")
+        return b
+    except AttributeError:
+        return False
+    except NameError
+        return False
Add some failsafes to strtobool
