diff --git a/packages/py-nestml/package.py b/packages/py-nestml/package.py
index aa061d53abb04dbc783af20a022450a240b20538..03fd0f217af3af710448a6620059cc848df6a851 100644
--- a/packages/py-nestml/package.py
+++ b/packages/py-nestml/package.py
@@ -22,8 +22,8 @@ class PyNestml(PythonPackage):
     version('5.3.0', sha256='8de543d7d3a166cd4d6a0d536a2d4e769513bbf8d7aeaf64458e9d9c21fe546e', expand=False)
     version('5.2.0', sha256='acb703bf9c7f70304bd5d547dccd6a6a219f8acb298a6412df779b808241eb14', expand=False)
 
-    depends_on('python@3.8:', when="@:5.3" type=('build', 'run'))
-    depends_on('python@3.9:', when="@5.3:" type=('build', 'run'))
+    depends_on('python@3.8:', when='@:5.3', type=('build', 'run'))
+    depends_on('python@3.9:', when='@6.0.0:', type=('build', 'run'))
     depends_on('py-pip', type='build')
     depends_on('py-numpy', type=('build', 'run'))
     depends_on('py-scipy', type=('build', 'run'))