File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -309,6 +309,9 @@ def check_config_h():
309
309
fn = sysconfig .get_config_h_filename ()
310
310
try :
311
311
config_h = pathlib .Path (fn ).read_text (encoding = 'utf-8' )
312
+ except OSError as exc :
313
+ return (CONFIG_H_UNCERTAIN , f"couldn't read '{ fn } ': { exc .strerror } " )
314
+ else :
312
315
substring = '__GNUC__'
313
316
if substring in config_h :
314
317
code = CONFIG_H_OK
@@ -317,8 +320,6 @@ def check_config_h():
317
320
code = CONFIG_H_NOTOK
318
321
mention_inflected = 'does not mention'
319
322
return code , f"{ fn !r} { mention_inflected } { substring !r} "
320
- except OSError as exc :
321
- return (CONFIG_H_UNCERTAIN , f"couldn't read '{ fn } ': { exc .strerror } " )
322
323
323
324
324
325
def is_cygwincc (cc ):
Original file line number Diff line number Diff line change @@ -140,12 +140,13 @@ def copy_file( # noqa: C901
140
140
if not (os .path .exists (dst ) and os .path .samefile (src , dst )):
141
141
try :
142
142
os .link (src , dst )
143
- return (dst , 1 )
144
143
except OSError :
145
144
# If hard linking fails, fall back on copying file
146
145
# (some special filesystems don't support hard linking
147
146
# even under Unix, see issue #8876).
148
147
pass
148
+ else :
149
+ return (dst , 1 )
149
150
elif link == 'sym' :
150
151
if not (os .path .exists (dst ) and os .path .samefile (src , dst )):
151
152
os .symlink (src , dst )
You can’t perform that action at this time.
0 commit comments