Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions backend/windmill-worker/src/python_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -665,13 +665,17 @@ pub async fn handle_python_job(
r#"
import os
import json
import importlib
{import_loader}
{import_base64}
{import_datetime}
import traceback
import sys
{os_main_override}
from {module_dir_dot} import {last} as inner_script

# Dynamic import to handle module names that are Python keywords
inner_script = importlib.import_module("{module_dir_dot}.{last}")

import re

with open("args.json") as f:
Expand Down Expand Up @@ -2303,12 +2307,16 @@ pub async fn start_worker(
let wrapper_content: String = format!(
r#"
import json
import importlib
{import_loader}
{import_base64}
{import_datetime}
import traceback
import sys
from {module_dir_dot} import {last} as inner_script

# Dynamic import to handle module names that are Python keywords
inner_script = importlib.import_module("{module_dir_dot}.{last}")

import re


Expand Down