diff --git a/guix/build/python-build-system.scm b/guix/build/python-build-system.scm
index d008ac2c69bbb666ecb23546a5a280d576efc44c..1ae42c00b49e21e467316c0ec228a0056c88767c 100644
--- a/guix/build/python-build-system.scm
+++ b/guix/build/python-build-system.scm
@@ -55,7 +55,10 @@ (define* (check #:key tests? test-target #:allow-other-keys)
     #t))
 
 (define (get-python-version python)
-  (string-take (string-take-right python 5) 3))
+  (let* ((version     (last (string-split python #\-)))
+         (components  (string-split version #\.))
+         (major+minor (take components 2)))
+    (string-join major+minor ".")))
 
 (define* (install #:key outputs inputs (configure-flags '())
                   #:allow-other-keys)