MCPcopy Index your code
hub / github.com/python/cpython / handle_permission_error

Function handle_permission_error

Lib/profiling/sampling/__main__.py:51–61  ·  view source on GitHub ↗

Handle PermissionError by displaying appropriate error message.

()

Source from the content-addressed store, hash-verified

49from .errors import SamplingUnknownProcessError, SamplingModuleNotFoundError, SamplingScriptNotFoundError
50
51def handle_permission_error():
52 """Handle PermissionError by displaying appropriate error message."""
53 if sys.platform == "darwin":
54 print(MACOS_PERMISSION_ERROR, file=sys.stderr)
55 elif sys.platform.startswith("linux"):
56 print(LINUX_PERMISSION_ERROR, file=sys.stderr)
57 elif sys.platform.startswith("win"):
58 print(WINDOWS_PERMISSION_ERROR, file=sys.stderr)
59 else:
60 print(GENERIC_PERMISSION_ERROR, file=sys.stderr)
61 sys.exit(1)
62
63if __name__ == '__main__':
64 try:

Callers 1

__main__.pyFile · 0.85

Calls 2

startswithMethod · 0.45
exitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…