Issue #17979: Fixed the re module in build with --disable-unicode.
diff --git a/Misc/NEWS b/Misc/NEWS
index b2485ef..9367bd5 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -58,6 +58,8 @@
 Library
 -------
 
+- Issue #17979: Fixed the re module in build with --disable-unicode.
+
 - Issue #17606: Fixed support of encoded byte strings in the XMLGenerator
  .characters() and ignorableWhitespace() methods.  Original patch by Sebastian
   Ortiz Vasquez.
diff --git a/Modules/sre.h b/Modules/sre.h
index 200e492..15ed3d5 100644
--- a/Modules/sre.h
+++ b/Modules/sre.h
@@ -23,8 +23,8 @@
 #  define SRE_MAXREPEAT ((SRE_CODE)PY_SSIZE_T_MAX + 1u)
 # endif
 #else
-# define SRE_CODE unsigned long
-# if SIZEOF_SIZE_T > SIZEOF_LONG
+# define SRE_CODE unsigned int
+# if SIZEOF_SIZE_T > SIZEOF_INT
 #  define SRE_MAXREPEAT (~(SRE_CODE)0)
 # else
 #  define SRE_MAXREPEAT ((SRE_CODE)PY_SSIZE_T_MAX + 1u)