Skip to content

Commit

Permalink
There was another
Browse files Browse the repository at this point in the history
  • Loading branch information
blast-hardcheese committed Oct 16, 2024
1 parent 1a58ce8 commit 76102b6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkgs/python-wrapped/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 76102b6

Please sign in to comment.