Skip to content

Commit 3f4305b

Browse files
committed
fix: Python 3.9 compatibility in git_guard.py
1 parent 21b000c commit 3f4305b

File tree

1 file changed

+3
-2
lines changed
  • src/ai_sbx/dockerfiles/devcontainer-base/claude-defaults/hooks

1 file changed

+3
-2
lines changed

src/ai_sbx/dockerfiles/devcontainer-base/claude-defaults/hooks/git_guard.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66

77
import json
88
import sys
9+
from typing import Optional
910

1011
PROTECTED = {"main", "master", "develop", "release"}
1112

1213

13-
def check_command(cmd: str) -> str | None:
14+
def check_command(cmd: str) -> Optional[str]:
1415
"""Return block reason or None if allowed."""
1516
parts = cmd.split()
1617

@@ -50,7 +51,7 @@ def check_command(cmd: str) -> str | None:
5051
return None
5152

5253

53-
def main():
54+
def main() -> None:
5455
try:
5556
data = json.loads(sys.stdin.read() or "{}")
5657
if data.get("tool_name") != "Bash":

0 commit comments

Comments
 (0)