File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -427,7 +427,7 @@ def is_same_entry(entry_1, entry_2):
427
427
return False
428
428
429
429
430
- def get_module_hash (src_code , key ):
430
+ def get_module_hash (src_code : str , key ) -> str :
431
431
"""
432
432
Return a SHA256 hash that uniquely identifies a module.
433
433
@@ -467,13 +467,13 @@ def get_module_hash(src_code, key):
467
467
if isinstance (key_element , tuple ):
468
468
# This should be the C++ compilation command line parameters or the
469
469
# libraries to link against.
470
- to_hash += list ( key_element )
470
+ to_hash += [ str ( e ) for e in key_element ]
471
471
elif isinstance (key_element , str ):
472
472
if key_element .startswith ("md5:" ) or key_element .startswith ("hash:" ):
473
473
# This is actually a sha256 hash of the config options.
474
474
# Currently, we still keep md5 to don't break old PyTensor.
475
475
# We add 'hash:' so that when we change it in
476
- # the futur , it won't break this version of PyTensor.
476
+ # the future , it won't break this version of PyTensor.
477
477
break
478
478
elif key_element .startswith ("NPY_ABI_VERSION=0x" ) or key_element .startswith (
479
479
"c_compiler_str="
Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ def output_subprocess_Popen(command, **params):
216
216
return (* out , p .returncode )
217
217
218
218
219
- def hash_from_code (msg ) :
219
+ def hash_from_code (msg : str | bytes ) -> str :
220
220
"""Return the SHA256 hash of a string or bytes."""
221
221
# hashlib.sha256() requires an object that supports buffer interface,
222
222
# but Python 3 (unicode) strings don't.
You can’t perform that action at this time.
0 commit comments