Skip to content

Commit cddf0b2

Browse files
committed
Append space only if missing
1 parent a323ef7 commit cddf0b2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

aiida_test_cache/mock_code/_hasher.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ def __call__(self, cwd: Path) -> str:
3434
file_content_bytes = file_obj.read()
3535
if path.name == self.SUBMIT_FILE:
3636
file_content_bytes = self._strip_submit_content(file_content_bytes)
37-
# TODO: REVERT THIS!!!!
38-
file_content_bytes += b" "
37+
# TODO: This is a temporary ugly hack for backward compatibility wit aiida-core<2.3
38+
# REVERT THIS after 0.0.1 release!
39+
if file_content_bytes[-1] != b" ":
40+
file_content_bytes += b" "
3941
self.log("##################")
4042
self.log("Stripped submit.sh")
4143
self.log(f"\n{file_content_bytes.decode('utf-8')}")

0 commit comments

Comments
 (0)