@vercel/python 6.0.6 → 6.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vc_init.py +25 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/python",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.7",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@types/jest": "27.4.1",
|
|
22
22
|
"@types/node": "14.18.33",
|
|
23
23
|
"@types/which": "3.0.0",
|
|
24
|
-
"@vercel/build-utils": "13.1.
|
|
24
|
+
"@vercel/build-utils": "13.1.1",
|
|
25
25
|
"cross-env": "7.0.3",
|
|
26
26
|
"execa": "^1.0.0",
|
|
27
27
|
"fs-extra": "11.1.1",
|
package/vc_init.py
CHANGED
|
@@ -19,6 +19,7 @@ import builtins
|
|
|
19
19
|
from typing import Callable, Literal, TextIO
|
|
20
20
|
import contextvars
|
|
21
21
|
import contextlib
|
|
22
|
+
import atexit
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
_here = os.path.dirname(__file__)
|
|
@@ -198,6 +199,30 @@ def enqueue_or_send_message(msg: dict):
|
|
|
198
199
|
_original_stderr.write(decoded + "\n")
|
|
199
200
|
|
|
200
201
|
|
|
202
|
+
def flush_init_log_buf_to_stderr():
|
|
203
|
+
global _init_log_buf, _init_log_buf_bytes
|
|
204
|
+
try:
|
|
205
|
+
combined: list[str] = []
|
|
206
|
+
for m in _init_log_buf:
|
|
207
|
+
payload = m.get("payload", {})
|
|
208
|
+
msg = payload.get("message")
|
|
209
|
+
if not msg:
|
|
210
|
+
continue
|
|
211
|
+
with contextlib.suppress(Exception):
|
|
212
|
+
decoded = base64.b64decode(msg).decode(errors="ignore")
|
|
213
|
+
combined.append(decoded)
|
|
214
|
+
if combined:
|
|
215
|
+
_stderr("".join(combined))
|
|
216
|
+
except Exception:
|
|
217
|
+
pass
|
|
218
|
+
finally:
|
|
219
|
+
_init_log_buf.clear()
|
|
220
|
+
_init_log_buf_bytes = 0
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
atexit.register(flush_init_log_buf_to_stderr)
|
|
224
|
+
|
|
225
|
+
|
|
201
226
|
if 'VERCEL_IPC_PATH' in os.environ:
|
|
202
227
|
with contextlib.suppress(Exception):
|
|
203
228
|
ipc_sock.connect(os.getenv("VERCEL_IPC_PATH", ""))
|