Skip to content

Commit 989e36f

Browse files
committed
Simplify
1 parent c012f3c commit 989e36f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

python/e2b_code_interpreter/code_interpreter_async.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ async def run_code(
191191
request_timeout = request_timeout or self.connection_config.request_timeout
192192
context_id = context.id if context else None
193193

194-
headers = {}
194+
headers: Dict[str, str] = {}
195195
if self._envd_access_token:
196-
headers = {"X-Access-Token": self._envd_access_token or ""}
196+
headers = {"X-Access-Token": self._envd_access_token}
197197

198198
try:
199199
async with self._client.stream(
@@ -253,9 +253,9 @@ async def create_code_context(
253253
if cwd:
254254
data["cwd"] = cwd
255255

256-
headers = {}
256+
headers: Dict[str, str] = {}
257257
if self._envd_access_token:
258-
headers = {"X-Access-Token": self._envd_access_token or ""}
258+
headers = {"X-Access-Token": self._envd_access_token}
259259

260260
try:
261261
response = await self._client.post(

python/e2b_code_interpreter/code_interpreter_sync.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ def run_code(
188188
request_timeout = request_timeout or self.connection_config.request_timeout
189189
context_id = context.id if context else None
190190

191-
headers = {}
191+
headers: Dict[str, str] = {}
192192
if self._envd_access_token:
193-
headers = {"X-Access-Token": self._envd_access_token or ""}
193+
headers = {"X-Access-Token": self._envd_access_token}
194194

195195
try:
196196
with self._client.stream(
@@ -250,9 +250,9 @@ def create_code_context(
250250
if cwd:
251251
data["cwd"] = cwd
252252

253-
headers = {}
253+
headers: Dict[str, str] = {}
254254
if self._envd_access_token:
255-
headers = {"X-Access-Token": self._envd_access_token or ""}
255+
headers = {"X-Access-Token": self._envd_access_token}
256256

257257
try:
258258
response = self._client.post(

0 commit comments

Comments
 (0)