File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 1- 20.08.04
1+ 20.08.04.2
Original file line number Diff line number Diff line change @@ -24,14 +24,19 @@ def calc_cur_checksum(file_lst, module_data):
2424 return hashlib .md5 (text ).hexdigest ()
2525
2626def load_checksum_trailer (module_data ):
27- with open (module_data ['ext_path' ], 'rb' ) as f :
28- f .seek (- _FMT .size , 2 )
29- json_len , tag = _FMT .unpack (f .read (_FMT .size ))
30- if tag != _TAG :
31- cppimport .config .quiet_print ("Missing trailer tag" )
32- return None , None
33- f .seek (- (_FMT .size + json_len ), 2 )
34- json_s = f .read (json_len )
27+ try :
28+ with open (module_data ['ext_path' ], 'rb' ) as f :
29+ f .seek (- _FMT .size , 2 )
30+ json_len , tag = _FMT .unpack (f .read (_FMT .size ))
31+ if tag != _TAG :
32+ cppimport .config .quiet_print ("Missing trailer tag" )
33+ return None , None
34+ f .seek (- (_FMT .size + json_len ), 2 )
35+ json_s = f .read (json_len )
36+ except FileNotFoundError :
37+ cppimport .config .quiet_print ("Failed to find compiled extension; rebuilding." )
38+ return None , None
39+
3540 try :
3641 deps , old_checksum = json .loads (json_s )
3742 except ValueError :
You can’t perform that action at this time.
0 commit comments