-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_execution.py
More file actions
37 lines (30 loc) · 950 Bytes
/
Copy pathdebug_execution.py
File metadata and controls
37 lines (30 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python3
"""
Debug module execution.
"""
try:
print("Starting execution...")
# Read and execute the file line by line to find where it fails
with open('src/alerts/alert_system.py', 'r') as f:
content = f.read()
print(f"File has {len(content)} characters")
print("First 200 characters:")
print(content[:200])
# Try to execute it
print("\nExecuting module...")
exec(content)
print("Module executed successfully!")
# Check what was defined
print("Checking for AlertGenerator in locals...")
if 'AlertGenerator' in locals():
print("AlertGenerator found!")
else:
print("AlertGenerator NOT found")
print("All locals:")
for name in locals():
if not name.startswith('_'):
print(f" {name}")
except Exception as e:
print(f"Error during execution: {e}")
import traceback
traceback.print_exc()