Skip to content

Commit 846bd79

Browse files
committed
Try packaging bin as data
1 parent b7b9fb1 commit 846bd79

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

sdk/python/flet/__pyinstaller/hook-flet.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77
if os.getenv("PACKAGE_FLETD_ONLY"):
88
bin_path = os.path.join(bin_path, "fletd*")
99

10-
# binaries = [(bin_path, "flet/bin")]
11-
binaries = [(bin_path, "flet/bin")]
10+
datas = [(bin_path, "flet/bin")]

sdk/python/flet/__pyinstaller/rthooks/pyi_rth_localhost_fletd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
logging.info("Running PyInstaller runtime hook for Flet...")
55

6-
os.environ["FLET_SERVER_IP"] = "localhost"
6+
os.environ["FLET_SERVER_IP"] = "127.0.0.1"

sdk/python/flet/flet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def _connect_internal(
153153
attached = False if not is_app and port != 0 else True
154154

155155
port = _start_flet_server(port, attached, assets_dir, web_renderer)
156-
server = f"http://localhost:{port}"
156+
server = f"http://127.0.0.1:{port}"
157157

158158
connected = threading.Event()
159159

sdk/python/flet/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,12 @@ def is_exe(fpath):
7474

7575

7676
def is_localhost_url(url):
77-
return "://localhost/" in url or "://localhost:" in url
77+
return (
78+
"://localhost/" in url
79+
or "://localhost:" in url
80+
or "://127.0.0.1/" in url
81+
or "://127.0.0.1:" in url
82+
)
7883

7984

8085
def get_current_script_dir():

0 commit comments

Comments
 (0)