Set default parameter for int.to_bytes() so that the editor is compatible with Python<3.12

The parameter is only standard since Python3.12.
This commit is contained in:
The Wobbler 2024-12-14 19:40:31 +01:00
parent fb7a160d00
commit 5cf5885d4b

View file

@ -22,7 +22,7 @@ class FileActions:
if dialog.exec(): if dialog.exec():
self.open_multiple_files(dialog.selectedFiles()) self.open_multiple_files(dialog.selectedFiles())
def create_file(self, content: bytes=(0).to_bytes(1)): def create_file(self, content: bytes=(0).to_bytes(1, "big")):
# open a dialog where the user can choose a new filepath and create an empty file at that path # open a dialog where the user can choose a new filepath and create an empty file at that path
# bytes=(0).to_bytes(1) creates a byte with only zeros in it # bytes=(0).to_bytes(1) creates a byte with only zeros in it