Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Commit

Permalink
Fix codegen script
Browse files Browse the repository at this point in the history
Summary: Migration to Python3 broke the script.

Reviewed By: aandreyeu

Differential Revision: D35731732

fbshipit-source-id: a2cb4a6f4a869bfc2d61de84a76994e370f5a809
  • Loading branch information
Wesley Elias Ribeiro authored and facebook-github-bot committed Apr 19, 2022
1 parent 757724b commit eb9f709
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cpp/codegen/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class MemoryDescription(namedtuple("MemoryDescription", ["fields", "typename"]))
TYPE_ID = 1

def __init__(self, **kwargs):
super(MemoryDescription, self).__init__(self, **kwargs)
super().__init__()

if self.fields is None:
raise ValueError("fields is required")
Expand All @@ -53,7 +53,7 @@ def __init__(self, **kwargs):

class EntryDescription(namedtuple("EntryDescription", ["id", "name", "memory_format"])):
def __init__(self, **kwargs):
super(EntryDescription, self).__init__(self, **kwargs)
super().__init__()

if self.id is None:
raise ValueError("id is required")
Expand Down
2 changes: 1 addition & 1 deletion cpp/codegen/codegen_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def sign_source(text):
in_text_pattern, CodegenProgram.SIGNED_SOURCE_TOKEN
)

digest = hashlib.md5(fixed_token_text).hexdigest()
digest = hashlib.md5(fixed_token_text.encode("utf-8")).hexdigest()

actual_hash = CodegenProgram.SIGNED_SOURCE_REPLACE_PATTERN.format(digest)

Expand Down

0 comments on commit eb9f709

Please sign in to comment.