
    q&i5                     d    S SK Jr  SSKrS SK Jr  \R
                  " S5       " S S\5      5       rg)   )_jcustomizer    N)_jexceptionzjava.lang.AutoCloseablec                   $    \ rS rSrSrS rS rSrg)_JCloseable   a  Customizer for ``java.lang.AutoCloseable`` and ``java.io.Closeable``

This customizer adds support of the ``with`` operator to all Java
classes that implement the Java ``AutoCloseable`` interface.

Example:

.. code-block:: python

    from java.nio.files import Files, Paths
    with Files.newInputStream(Paths.get("foo")) as fd:
      # operate on the input stream

    # Input stream closes at the end of the block.

c                     U $ )N )selfs    J/var/www/html/banglarbhumi/venv/lib/python3.13/site-packages/jpype/_jio.py	__enter___JCloseable.__enter__-   s        c                     [         R                  " 5       n U R                  5         g ! [        R                   a  nUS   c  Ue S nAg S nAff = f)Nr   )_sysexc_infocloser   
JException)r   exception_typeexception_value	tracebackinfojexs         r   __exit___JCloseable.__exit__0   sD    }}	JJL%% 	Q	  	s   ( AA		Ar
   N)__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes__r
   r   r   r   r      s    "r   r   ) r   sysr   r   JImplementationForobjectr   r
   r   r   <module>r&      s7   $      !:;&  <r   