From a9be4deb950ca27fdc681dbb9cfe20499e7a16d1 Mon Sep 17 00:00:00 2001 From: Arseny Boykov <36469655+Bobronium@users.noreply.github.com> Date: Thu, 21 Jul 2022 01:39:19 +0400 Subject: [PATCH 1/3] Use actual pyp interpreter in shebang by default --- pyp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyp.py b/pyp.py index b1e1614..acd1047 100644 --- a/pyp.py +++ b/pyp.py @@ -253,7 +253,7 @@ def __init__(self) -> None: # Modules from which automatic imports work without qualification, ordered by AST encounter self.wildcard_imports: List[str] = [] - self.shebang: str = "#!/usr/bin/env python3" + self.shebang: str = f"#! {sys.interpreter}" if config_contents.startswith("#!"): self.shebang = "\n".join( itertools.takewhile(lambda l: l.startswith("#"), config_contents.splitlines()) From f32f710b157b683a30f041597da94543a15c000d Mon Sep 17 00:00:00 2001 From: Arseny Boykov <36469655+Bobronium@users.noreply.github.com> Date: Thu, 21 Jul 2022 01:49:41 +0400 Subject: [PATCH 2/3] Remove space before #! --- pyp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyp.py b/pyp.py index acd1047..e48274d 100644 --- a/pyp.py +++ b/pyp.py @@ -253,7 +253,7 @@ def __init__(self) -> None: # Modules from which automatic imports work without qualification, ordered by AST encounter self.wildcard_imports: List[str] = [] - self.shebang: str = f"#! {sys.interpreter}" + self.shebang: str = f"#!{sys.interpreter}" if config_contents.startswith("#!"): self.shebang = "\n".join( itertools.takewhile(lambda l: l.startswith("#"), config_contents.splitlines()) From 817e8432570f29722b953f2e972208e84b3458c0 Mon Sep 17 00:00:00 2001 From: Arseny Boykov <36469655+Bobronium@users.noreply.github.com> Date: Thu, 21 Jul 2022 02:24:26 +0400 Subject: [PATCH 3/3] What's sys.interpteter? --- pyp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyp.py b/pyp.py index e48274d..56d5051 100644 --- a/pyp.py +++ b/pyp.py @@ -253,7 +253,7 @@ def __init__(self) -> None: # Modules from which automatic imports work without qualification, ordered by AST encounter self.wildcard_imports: List[str] = [] - self.shebang: str = f"#!{sys.interpreter}" + self.shebang: str = f"#!{sys.executable}" if config_contents.startswith("#!"): self.shebang = "\n".join( itertools.takewhile(lambda l: l.startswith("#"), config_contents.splitlines())