Skip to main content

Python ContextManager timeout handler library.

Project description

CMTimeOut

Python ContextManager timeout handler library.

Install

$ pip install cmtimeout

Examples

Example 1:

from cmtimeout import CMTimeOut

with CMTimeOut(2):
    with open("interface.fifo", "w") as f:
        pass

Example 2:

from cmtimeout import CMTimeOut, CMTimeOutException

try:
    with CMTimeOut(2, True):
        with open("interface.fifo", "w") as f:
            pass
except CMTimeOutException:
    print("opening file failed.")

Contribute

Kindly keep me posted in case of any issue or question by opening new file is issue page or send me a pull request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for cmtimeout, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size cmtimeout-1.0.1.tar.gz (2.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page