Skip to content
Snippets Groups Projects
Commit 67ba9c72 authored by Tim Jaacks's avatar Tim Jaacks
Browse files

Fix pathlib usage

parent 718b3708
No related branches found
No related tags found
1 merge request!10Fix pathlib usage
Pipeline #8068 passed with stage
in 18 seconds
...@@ -48,7 +48,7 @@ def integrate_into_manifest( ...@@ -48,7 +48,7 @@ def integrate_into_manifest(
# Parse manifest file # Parse manifest file
try: try:
manifest = etree.parse(manifest_filepath) manifest = etree.parse(manifest_filepath.as_posix())
except FileNotFoundError: except FileNotFoundError:
sys.exit("ERROR: file '%s' not found in manifest repo" % manifest_file) sys.exit("ERROR: file '%s' not found in manifest repo" % manifest_file)
...@@ -83,11 +83,9 @@ def integrate_into_manifest( ...@@ -83,11 +83,9 @@ def integrate_into_manifest(
# We are doing this using a plain text replace action. Unfortunately # We are doing this using a plain text replace action. Unfortunately
# all python libraries for handling XML data are not able to preserve # all python libraries for handling XML data are not able to preserve
# the file layout, and we want a minimal diff. # the file layout, and we want a minimal diff.
with open(manifest_filepath, "r") as file: content = manifest_filepath.read_text()
content = file.read()
content = content.replace(old_revision, new_revision) content = content.replace(old_revision, new_revision)
with open(manifest_filepath, "w") as file: manifest_filepath.write_text(content)
file.write(content)
# Make an API request to create the gitlab.user object # Make an API request to create the gitlab.user object
gitlab.auth() gitlab.auth()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment