U
    #hK                  
   @   s  d dl Z d dlZed ede   ede j  ede jdd  d ed z(d dlZed	 ed
eed  W n@ ek
r Z	 z"ede	  d dl
Z
e
  W 5 dZ	[	X Y nX ed z:d dlZedZeedZed edee  W nB ek
rJ Z	 z"ede	  d dl
Z
e
  W 5 dZ	[	X Y nX ed z`eddZe ZW 5 Q R X dekreddkred ed ned ned W n2 ek
r Z	 zede	  W 5 dZ	[	X Y nX ed dS )    Nz'=== Debugging Uvicorn Import Issue ===
zCurrent directory: zPython executable: zPython path (first 3):    
z!1. Testing direct import of main:u   ✅ Direct import successfulz   App object exists: appu   ❌ Direct import failed: z!
2. Testing uvicorn-style import:mainu#   ✅ Uvicorn-style import successfulz   App type: u!   ❌ Uvicorn-style import failed: z 
3. Checking main.py for exec():zmain.pyrz+exec(open('real_data_endpoints.py').read())z%# exec(open('real_data_endpoints.py')u8   ❌ Found uncommented exec() line - THIS IS THE PROBLEM!z)   Run: python fix_and_check.py to fix itu    ✅ exec() line is commented outu   ✅ No exec() line foundu   ❌ Could not read main.py: z
=== Debug Complete ===)sysosprintgetcwd
executablepathr   hasattr	Exceptione	traceback	print_exc	importlibimport_modulemodulegetattrr   typeopenfreadZcontentfind r   r   ./debug_uvicorn_import.py<module>   sL   




 