
    g                     N    d dl Z d dlZd dlZdZdZ G d dej
                        Zy)    Nss  
# The event loop is not fork-safe, and it's easy to initialize an asyncio.Future
# at startup, which in turn creates the default event loop and prevents forking.
# Explicitly disallow the default event loop so that an error will be raised
# if something tries to touch it.
import asyncio
asyncio.set_event_loop(None)

import importlib
import tornado

for mod in tornado.__all__:
    if mod == "curl_httpclient":
        # This module has extra dependencies; skip it if they're not installed.
        try:
            import pycurl
        except ImportError:
            continue
    importlib.import_module(f"tornado.{mod}")
s.  
import sys
import tornado

if "tornado.web" in sys.modules:
    raise Exception("unexpected eager import")

# Trigger a lazy import by referring to something in a submodule.
tornado.web.RequestHandler

if "tornado.web" not in sys.modules:
    raise Exception("lazy import did not update sys.modules")
c                       e Zd Zd Zd Zd Zy)
ImportTestc                     t        j                  t        j                  gt         j                        }|j                  t               | j                  |j                  d       y N)stdinr   )	
subprocessPopensys
executablePIPEcommunicate_import_everythingassertEqual
returncodeselfprocs     M/var/www/openai/venv/lib/python3.12/site-packages/tornado/test/import_test.pytest_import_everythingz!ImportTest.test_import_everything+   sD    
  0
H+,!,    c                     t        j                  t        j                  gt         j                        }|j                  t               | j                  |j                  d       y r   )	r   r	   r
   r   r   r   _import_lazyr   r   r   s     r   test_lazy_importzImportTest.test_lazy_import4   sA     0
H&!,r   c                 \   dd l }dd l}| j                  |j                  j                  |j
                  j                         | j                  |j                  j                  |j
                  j                         | j                  |j
                  j                  |j                         y )Nr   )tornadoasyncioassertIsioloopTimeoutErrorutilgen)r   r   r   s      r   test_import_aliaseszImportTest.test_import_aliases:   sj    gnn117<<3L3LMgkk..0I0IJgll//1E1EFr   N)__name__
__module____qualname__r   r   r"    r   r   r   r   *   s    --Gr   r   )r   r
   unittestr   r   TestCaser   r&   r   r   <module>r)      s1     
  *G"" Gr   