8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
os.Executable()
1 parent e9cde5f commit ed47ed3Copy full SHA for ed47ed3
stdlib/sys/sys.go
@@ -19,6 +19,7 @@ package sys
19
20
import (
21
"os"
22
+ "runtime"
23
24
"github.com/go-python/gpython/py"
25
)
@@ -659,7 +660,14 @@ func init() {
659
660
661
executable, err := os.Executable()
662
if err != nil {
- panic(err)
663
+ switch runtime.GOOS {
664
+ case "js", "wasip1":
665
+ // These platforms don't implement os.Executable (at least as of Go
666
+ // 1.21), see https://github.com/tailscale/tailscale/pull/8325
667
+ executable = "gpython"
668
+ default:
669
+ panic(err)
670
+ }
671
}
672
673
globals := py.StringDict{
0 commit comments