From d069708c79604fe10c9d224afbeb3c25b63653f8 Mon Sep 17 00:00:00 2001 From: initializedd <119122691+initializedd@users.noreply.github.com> Date: Fri, 27 Sep 2024 18:52:07 +0100 Subject: [PATCH] Support netsim.ini tmpdir on linux --- bumble/transport/android_netsim.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bumble/transport/android_netsim.py b/bumble/transport/android_netsim.py index 264266df..9a3e016c 100644 --- a/bumble/transport/android_netsim.py +++ b/bumble/transport/android_netsim.py @@ -70,6 +70,9 @@ def get_ini_dir() -> Optional[pathlib.Path]: elif sys.platform == 'linux': if xdg_runtime_dir := os.environ.get('XDG_RUNTIME_DIR', None): return pathlib.Path(xdg_runtime_dir) + tmpdir = os.environ.get('TMPDIR', '/tmp') + if pathlib.Path(tmpdir).is_dir(): + return pathlib.Path(tmpdir) elif sys.platform == 'win32': if local_app_data_dir := os.environ.get('LOCALAPPDATA', None): return pathlib.Path(local_app_data_dir) / 'Temp'