File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 4
4
5
5
from future import standard_library
6
6
standard_library .install_aliases ()
7
- from configparser import ConfigParser
7
+ import configparser
8
8
9
9
import os
10
10
import sys
@@ -47,7 +47,10 @@ def pkg_commit_hash(pkg_path):
47
47
pth = os .path .join (pkg_path , COMMIT_INFO_FNAME )
48
48
if not os .path .isfile (pth ):
49
49
raise IOError ('Missing commit info file %s' % pth )
50
- cfg_parser = ConfigParser ()
50
+ if PY3 :
51
+ cfg_parser = configparser .RawConfigParser ()
52
+ else :
53
+ cfg_parser = configparser .ConfigParser ()
51
54
cfg_parser .read (pth )
52
55
archive_subst = cfg_parser .get ('commit hash' , 'archive_subst_hash' )
53
56
if not archive_subst .startswith ('$Format' ): # it has been substituted
Original file line number Diff line number Diff line change @@ -60,8 +60,8 @@ class BuildWithCommitInfoCommand(build_py):
60
60
package for an example.
61
61
"""
62
62
def run (self ):
63
- from configparser import ConfigParser
64
63
import subprocess
64
+ import configparser
65
65
66
66
build_py .run (self )
67
67
proc = subprocess .Popen ('git rev-parse --short HEAD' ,
@@ -74,7 +74,10 @@ def run(self):
74
74
repo_commit = repo_commit .decode ()
75
75
76
76
# We write the installation commit even if it's empty
77
- cfg_parser = ConfigParser ()
77
+ if PY3 :
78
+ cfg_parser = configparser .RawConfigParser ()
79
+ else :
80
+ cfg_parser = configparser .ConfigParser ()
78
81
cfg_parser .read (pjoin ('nipype' , 'COMMIT_INFO.txt' ))
79
82
cfg_parser .set ('commit hash' , 'install_hash' , repo_commit .strip ())
80
83
out_pth = pjoin (self .build_lib , 'nipype' , 'COMMIT_INFO.txt' )
You can’t perform that action at this time.
0 commit comments