check correct variable for error
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 09c430f..7a02b75 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -3584,7 +3584,7 @@
     if ((*s == -1) && PyErr_Occurred())
         goto exit;
     *ns = PyLong_AsLong(PyTuple_GET_ITEM(divmod, 1));
-    if ((*s == -1) && PyErr_Occurred())
+    if ((*ns == -1) && PyErr_Occurred())
         goto exit;
 
     result = 1;