Claude Code Claude Opus 4.6 commited on
Commit
f7ea576
·
1 Parent(s): f8f6a57

Claude Code: Fix import path - add openclaw parent dir to sys.path for agents module

Browse files
Files changed (1) hide show
  1. openclaw/__init__.py +6 -2
openclaw/__init__.py CHANGED
@@ -4,9 +4,13 @@ import sys
4
  from pathlib import Path
5
 
6
  # Get the openclaw package directory
7
- _openclaw_dir = Path(__file__).parent / ".openclaw"
 
 
 
 
 
8
 
9
- # Add .openclaw to the module search path
10
  if str(_openclaw_dir) not in sys.path:
11
  sys.path.insert(0, str(_openclaw_dir))
12
 
 
4
  from pathlib import Path
5
 
6
  # Get the openclaw package directory
7
+ _package_dir = Path(__file__).parent
8
+ _openclaw_dir = _package_dir / ".openclaw"
9
+
10
+ # Add both openclaw parent (for agents) and .openclaw to the module search path
11
+ if str(_package_dir) not in sys.path:
12
+ sys.path.insert(0, str(_package_dir))
13
 
 
14
  if str(_openclaw_dir) not in sys.path:
15
  sys.path.insert(0, str(_openclaw_dir))
16