Skip to main content

Signal blocking under Linux & OS X

Project description

Provides access to sigprocmask(2) and friends and convenience wrappers to python application developers wanting to SIG_BLOCK and SIG_UNBLOCK signals in critical sections of their code.

Most common usage

from signal import SIGINT, SIGTERM
from pysigset import suspended_signals

with suspended_signals(SIGINT, SIGTERM):
    # Signals are blocked here..
    pass
# Any pending signal is fired now..

Also available

sigaddset(*args)
    int sigaddset(sigset_t *set, int signum)

sigdelset(*args)
    int sigdelset(sigset_t *set, int signum)

sigemptyset(*args)
    int sigemptyset(sigset_t *set)

sigfillset(*args)
    int sigfillset(sigset_t *set)

sigismember(*args)
    int sigismember(const sigset_t *set, int signum)

sigpending(*args)
    int sigpending(sigset_t *set)

sigprocmask(*args)
    int sigprocmask(int how, const sigset_t *set, sigset_t *oldset)

sigsuspend(*args)
    int sigsuspend(const sigset_t *mask)

Similar tools

python-signalfd provides access to sigprocmask and signalfd. Its advantage is access to signalfd. Its disadvantage is a compilation requirement.

pysigset has a pythonic interface and requires only ctypes access to libc.so.6 or libSystem.B.dylib.

Changes

2021-05-03: 0.4.0

  • Change License to LGPL 3.

2015-09-22: 0.3.2

  • Python 3 compatibility (thanks Kevin Pouget).

  • Update version, update trove classifiers; adding Python 3, moving to Production/Stable.

2015-05-23: 0.2.2

  • Fix so we can install using setup.py again.

2013-07-30: 0.2.1

  • Fix so the RST is displayed on PyPI.

2013-07-30: 0.2

  • Add support for OS X / Darwin (thanks Dan Sully (dsully))

  • Add support for easy uploading to PyPI.

2013-04-15: 0.1

  • Initial release.

Project details


Download files

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

Source Distribution

pysigset-0.4.0.tar.gz (4.7 kB view details)

Uploaded Source

File details

Details for the file pysigset-0.4.0.tar.gz.

File metadata

  • Download URL: pysigset-0.4.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.18.4 setuptools/37.0.0 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/2.7.17

File hashes

Hashes for pysigset-0.4.0.tar.gz
Algorithm Hash digest
SHA256 13ef98b058489ff572b6667c38970a544699895c0844cb3ac2494e3a59ac51e6
MD5 66179cdaf5e4b18f46493afec463bd36
BLAKE2b-256 204dbf32d6c883175ad8752ba4668baf11c1e941dccd137e3b8bae012fa24331

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page