Should compare errno to 0, not NULL
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 3aca3a5..2d42dc0 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -147,7 +147,7 @@
 	p = function(&when);
 	if (p == NULL) {
 #ifdef EINVAL
-		if (errno == NULL)
+		if (errno == 0)
 			errno = EINVAL;
 #endif
 		return err_errno(IOError);