Skip to content

Commit e29ac95

Browse files
authored
Merge pull request #2794 from oesteban/maint/configparser-deprecation
[MAINT] One less DeprecationWarning (configparser)
2 parents 09f325a + 29ff9da commit e29ac95

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

nipype/pkg_info.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ def pkg_commit_hash(pkg_path):
5151
raise IOError('Missing commit info file %s' % pth)
5252
cfg_parser = configparser.RawConfigParser()
5353
with open(pth, encoding='utf-8') as fp:
54-
cfg_parser.readfp(fp)
54+
if sys.version_info >= (3, 2):
55+
cfg_parser.read_file(fp)
56+
else:
57+
cfg_parser.readfp(fp)
5558
archive_subst = cfg_parser.get('commit hash', 'archive_subst_hash')
5659
if not archive_subst.startswith('$Format'): # it has been substituted
5760
return 'archive substitution', archive_subst

0 commit comments

Comments
 (0)