From 29ff9dab279aff96b24721b8e062517a19a6d9b3 Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 22 Nov 2018 09:49:28 -0800 Subject: [PATCH] [MAINT] One less DeprecationWarning (configparser) --- nipype/pkg_info.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nipype/pkg_info.py b/nipype/pkg_info.py index f2aa07030d..8492d237d7 100644 --- a/nipype/pkg_info.py +++ b/nipype/pkg_info.py @@ -51,7 +51,10 @@ def pkg_commit_hash(pkg_path): raise IOError('Missing commit info file %s' % pth) cfg_parser = configparser.RawConfigParser() with open(pth, encoding='utf-8') as fp: - cfg_parser.readfp(fp) + if sys.version_info >= (3, 2): + cfg_parser.read_file(fp) + else: + cfg_parser.readfp(fp) archive_subst = cfg_parser.get('commit hash', 'archive_subst_hash') if not archive_subst.startswith('$Format'): # it has been substituted return 'archive substitution', archive_subst