File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1403,16 +1403,16 @@ def XcodeVersion():
14031403 except :
14041404 version = CLTVersion ()
14051405 if version :
1406- version = re .match (r'(\d\.\d\.?\d* )' , version ).groups ()[0 ]
1406+ version = re .search (r'^ (\d{1,2} \.\d(\.\d+)? )' , version ).groups ()[0 ]
14071407 else :
14081408 raise GypError ("No Xcode or CLT version detected!" )
14091409 # The CLT has no build information, so we return an empty string.
14101410 version_list = [version , '' ]
14111411 version = version_list [0 ]
14121412 build = version_list [- 1 ]
1413- # Be careful to convert "4.2" to "0420":
1414- version = version .split ()[- 1 ].replace ('.' , '' )
1415- version = ( version + '0' * ( 3 - len ( version ))). zfill ( 4 )
1413+ # Be careful to convert "4.2" to "0420" and "10.0" to "1000" :
1414+ version = format ( '' . join (( version .split ()[- 1 ].split ('.' ) + [ '0' , '0' ])[: 3 ]),
1415+ '>04s' )
14161416 if build :
14171417 build = build .split ()[- 1 ]
14181418 XCODE_VERSION_CACHE = (version , build )
You can’t perform that action at this time.
0 commit comments