77import os
88import pickle
99import shelve
10- import sys
10+ import struct
1111
1212from bugbug import db , repository
1313from bugbug .utils import ExpQueue , LMDBDict
@@ -116,7 +116,7 @@ def get_touched_together(f1, f2):
116116 if key not in touched_together :
117117 return 0
118118
119- return int . from_bytes ( touched_together [key ], sys . byteorder )
119+ return struct . unpack ( "I" , touched_together [key ])[ 0 ]
120120
121121
122122def set_touched_together (f1 , f2 ):
@@ -125,11 +125,11 @@ def set_touched_together(f1, f2):
125125 key = get_touched_together_key (f1 , f2 )
126126
127127 if key not in touched_together :
128- touched_together [key ] = ( 1 ). to_bytes ( 4 , sys . byteorder )
128+ touched_together [key ] = struct . pack ( "I" , 1 )
129129 else :
130- touched_together [key ] = (
131- int . from_bytes ( touched_together [key ], sys . byteorder ) + 1
132- ). to_bytes ( 4 , sys . byteorder )
130+ touched_together [key ] = struct . pack (
131+ "I" , struct . unpack ( "I" , touched_together [key ])[ 0 ] + 1
132+ )
133133
134134
135135def update_touched_together ():
0 commit comments