Skip to content

Commit 56e6fcb

Browse files
committed
Use f-string instead of string concatenation
1 parent 3a352ca commit 56e6fcb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pytensor/utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,8 @@ def hash_from_code(msg: str | bytes) -> str:
191191
# but Python 3 (unicode) strings don't.
192192
if isinstance(msg, str):
193193
msg = msg.encode()
194-
# Python 3 does not like module names that start with
195-
# a digit.
196-
return "m" + hashlib.sha256(msg).hexdigest()
194+
# Python 3 does not like module names that start with a digit.
195+
return f"m{hashlib.sha256(msg).hexdigest()}"
197196

198197

199198
def uniq(seq: Sequence) -> list:

0 commit comments

Comments
 (0)