From a9aa413d58e9b3d7baf7c0220b76c81f735ba95f Mon Sep 17 00:00:00 2001 From: orco Date: Fri, 14 Jan 2022 17:15:10 +0100 Subject: [PATCH 1/2] [FIX] TypeError from 'v' of ANTs version string Building ANTs from source code, actually the recommended procedure, leads to a version string with a leading `v` that causes the `TypeError`. This little fix may solve #3427 --- nipype/interfaces/ants/base.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nipype/interfaces/ants/base.py b/nipype/interfaces/ants/base.py index a3b0109c7b..d1c8fbcf1f 100644 --- a/nipype/interfaces/ants/base.py +++ b/nipype/interfaces/ants/base.py @@ -42,6 +42,9 @@ def parse_version(raw_info): # -githash may or may not be appended v_string = v_string.split("-")[0] + # if there is a 'v' at the beginning, it may be stripped + v_string = v_string.lstrip('v') + # 2.2.0-equivalent version string if "post" in v_string and LooseVersion(v_string) >= LooseVersion( From 26e805b409e1dcae4616b3edb96b8f39b58e2e53 Mon Sep 17 00:00:00 2001 From: 0rC0 Date: Sat, 15 Jan 2022 17:58:43 +0100 Subject: [PATCH 2/2] black --- nipype/interfaces/ants/base.py | 1 - 1 file changed, 1 deletion(-) diff --git a/nipype/interfaces/ants/base.py b/nipype/interfaces/ants/base.py index d1c8fbcf1f..e61fb2d6c3 100644 --- a/nipype/interfaces/ants/base.py +++ b/nipype/interfaces/ants/base.py @@ -45,7 +45,6 @@ def parse_version(raw_info): # if there is a 'v' at the beginning, it may be stripped v_string = v_string.lstrip('v') - # 2.2.0-equivalent version string if "post" in v_string and LooseVersion(v_string) >= LooseVersion( "2.1.0.post789"