diff --git a/PKG-INFO b/PKG-INFO
index fc45b022e677c78c60280a2ab69a365177f4d36b..34961a708d85ead726664a499fb4771737e50b62 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: swh.loader.cvs
-Version: 0.4.0
+Version: 0.4.1
 Summary: Software Heritage CVS Loader
 Home-page: https://forge.softwareheritage.org/diffusion/swh-loader-cvs
 Author: Software Heritage developers
diff --git a/setup.py b/setup.py
index 5f2ed363848eda990ea01c99c757ca69e3030e8d..515c735a33cbc6e7c0c40025c70c71f481f3efdb 100755
--- a/setup.py
+++ b/setup.py
@@ -1,11 +1,12 @@
 #!/usr/bin/env python3
-# Copyright (C) 2019-2021  The Software Heritage developers
+# Copyright (C) 2019-2022  The Software Heritage developers
 # See the AUTHORS file at the top-level directory of this distribution
 # License: GNU Affero General Public License version 3, or any later version
 # See top-level LICENSE file for more information
 
 from io import open
 from os import path
+import sys
 
 from setuptools import Extension, find_packages, setup
 
@@ -36,6 +37,10 @@ def parse_requirements(*names):
     return requirements
 
 
+macros = []
+if sys.version_info[:2] >= (3, 10):  # https://github.com/python/cpython/issues/85115
+    macros.append(("PY_SSIZE_T_CLEAN", None))
+
 setup(
     name="swh.loader.cvs",
     description="Software Heritage CVS Loader",
@@ -76,6 +81,7 @@ setup(
                 "swh/loader/cvs/rcsparse/py-rcsparse.c",
                 "swh/loader/cvs/rcsparse/rcsparse.c",
             ],
+            define_macros=macros,
         )
     ],
 )
diff --git a/swh.loader.cvs.egg-info/PKG-INFO b/swh.loader.cvs.egg-info/PKG-INFO
index fc45b022e677c78c60280a2ab69a365177f4d36b..34961a708d85ead726664a499fb4771737e50b62 100644
--- a/swh.loader.cvs.egg-info/PKG-INFO
+++ b/swh.loader.cvs.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: swh.loader.cvs
-Version: 0.4.0
+Version: 0.4.1
 Summary: Software Heritage CVS Loader
 Home-page: https://forge.softwareheritage.org/diffusion/swh-loader-cvs
 Author: Software Heritage developers