Skip to main content
def pledge(promises: Optional[Iterable[str]] = None,
           execpromises: Optional[Iterable[str]] = None) -> None: ...

Throws OSError if the platform does not support pledge(2) or if the pledge fails.

Example

The following will restrict the current process to only the stdio and tty promises, and then attempt to violate that restriction:

import pypledge
pypledge.pledge(['stdio', 'tty'])
f = open('foo.txt')

On OpenBSD 5.9, this will terminate with SIGABRT because the rpath promise was required.

On other platforms, this will throw OSError.

Metadata

Release files for pypledge 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pypledge 0.3.1
File Size Uploaded
pypledge-0.3.1.tar.gz 2.1 kB Details

Release files / pypledge-0.3.1.tar.gz

Download URL pypledge-0.3.1.tar.gz
Size 2.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e6e8438f722605b13c9cbf5259b6593022045c815e51db55f41a86660e53791f
BLAKE2b-256 checksum
How to use checksums
ff8368ede0961a31c7deda0833a682d1c2be5bd8f57bb022341fff375300ec56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.7

Release history Release notifications | RSS feed

This release

0.3.1 This release

1 release file

0.3

1 release file

0.2.1

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page