Skip to content

Commit

Permalink
fix: python2.7 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
lcian committed Oct 1, 2024
1 parent eb074e0 commit ca46f37
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions pwnlib/commandline/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,10 @@ def get_docker_image_libraries():
ldd_output = subprocess.check_output([
"docker",
"run",
"--rm",
*(["--privileged"] if is_jailed else ["--entrypoint", "/bin/sh"]),
image_sha,
*ldd_command,
],
"--rm"
] + (["--privileged"] if is_jailed else ["--entrypoint", "/bin/sh"]) + [
image_sha,
] + ldd_command,
shell=False
).decode()

Expand All @@ -83,10 +82,9 @@ def get_docker_image_libraries():
"docker",
"run",
"--rm",
*(["--privileged"] if is_jailed else ["--entrypoint", "/bin/sh"]),
image_sha,
*cat_command,
],
] + (["--privileged"] if is_jailed else ["--entrypoint", "/bin/sh"]) + [
image_sha
] + cat_command,
shell=False
)
open(basename, "wb").write(contents)
Expand Down

0 comments on commit ca46f37

Please sign in to comment.