Skip to content

Commit 08d82a8

Browse files
committed
More 3.8 compatibility fixes
1 parent 73dc6c5 commit 08d82a8

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

ecoinvent_interface/core.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def _get_credentials(self, post_data: dict) -> None:
127127
headers = {
128128
"ecoinvent-api-client-library": "ecoinvent_interface",
129129
"ecoinvent-api-client-library-version": __version__,
130-
} | self.custom_headers
130+
}.update(self.custom_headers)
131131
response = requests.post(sso_url, post_data, headers=headers, timeout=20)
132132

133133
if response.ok:
@@ -148,7 +148,7 @@ def _get_all_reports(self) -> dict:
148148
"Authorization": f"Bearer {self.access_token}",
149149
"ecoinvent-api-client-library": "ecoinvent_interface",
150150
"ecoinvent-api-client-library-version": __version__,
151-
} | self.custom_headers
151+
}.update(self.custom_headers)
152152
message = """Requesting URL.
153153
URL: {reports_url}
154154
Class: {self.__class__.__name__}
@@ -166,7 +166,7 @@ def _get_all_files(self) -> dict:
166166
"Authorization": f"Bearer {self.access_token}",
167167
"ecoinvent-api-client-library": "ecoinvent_interface",
168168
"ecoinvent-api-client-library-version": __version__,
169-
} | self.custom_headers
169+
}.update(self.custom_headers)
170170
message = """Requesting URL.
171171
URL: {files_url}
172172
Class: {self.__class__.__name__}
@@ -254,7 +254,7 @@ def _download_api_file(
254254
"Authorization": f"Bearer {self.access_token}",
255255
"ecoinvent-api-client-library": "ecoinvent_interface",
256256
"ecoinvent-api-client-library-version": __version__,
257-
} | self.custom_headers
257+
}.update(self.custom_headers)
258258
self._streaming_download(
259259
url=url,
260260
params=params,
@@ -273,7 +273,7 @@ def _download_s3(
273273
"Authorization": f"Bearer {self.access_token}",
274274
"ecoinvent-api-client-library": "ecoinvent_interface",
275275
"ecoinvent-api-client-library-version": __version__,
276-
} | self.custom_headers
276+
}.update(self.custom_headers)
277277
s3_link = requests.get(url, headers=headers, timeout=20).json()["download_url"]
278278
self._streaming_download(
279279
url=s3_link, params={}, directory=directory, filename=filename

ecoinvent_interface/process_interface.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def _json_request(self, url: str) -> Union[dict, list]:
148148
"Authorization": f"Bearer {self.access_token}",
149149
"ecoinvent-api-client-library": "ecoinvent_interface",
150150
"ecoinvent-api-client-library-version": __version__,
151-
} | self.custom_headers
151+
}.update(self.custom_headers)
152152
message = """Requesting URL.
153153
URL: {url}
154154
Class: {self.__class__.__name__}
@@ -189,7 +189,7 @@ def get_file(self, file_type: ProcessFileType, directory: Path) -> Path:
189189
"Authorization": f"Bearer {self.access_token}",
190190
"ecoinvent-api-client-library": "ecoinvent_interface",
191191
"ecoinvent-api-client-library-version": __version__,
192-
} | self.custom_headers
192+
}.update(self.custom_headers)
193193
if meta.get("type").lower() == "xml":
194194
headers["Accept"] = "text/plain"
195195

0 commit comments

Comments
 (0)