From 76102b6522f397fe9f59e51c6d4a3c3ba38a1a15 Mon Sep 17 00:00:00 2001 From: Devon Stewart Date: Wed, 16 Oct 2024 10:13:56 -0700 Subject: [PATCH] There was another --- pkgs/python-wrapped/main.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/python-wrapped/main.go b/pkgs/python-wrapped/main.go index a2147f8..a6399a2 100644 --- a/pkgs/python-wrapped/main.go +++ b/pkgs/python-wrapped/main.go @@ -38,13 +38,18 @@ func modern() { } } +// returns whether a Nix channel works with RTLD loader +func channelWorksWithRtldLoader(channel string) bool { + return channel != "" && channel != "legacy" && channel != "stable-21_11" +} + func main() { os.Unsetenv("PYTHONNOUSERSITE") - if val, ok := os.LookupEnv("REPLIT_NIX_CHANNEL"); !ok || val == "legacy" || val == "" { - legacy() - } else { + if val, ok := os.LookupEnv("REPLIT_NIX_CHANNEL"); ok && channelWorksWithRtldLoader(val) { modern() + } else { + legacy() } if err := syscall.Exec(PythonExePath, os.Args, os.Environ()); err != nil {