opt
/
hc_python
/
lib
/
python3.12
/
site-packages
/
sentry_sdk
/
Go to Home Directory
+
Upload
Create File
root@0UT1S:~$
Execute
By Order of Mr.0UT1S
[DIR] ..
N/A
[DIR] __pycache__
N/A
[DIR] ai
N/A
[DIR] crons
N/A
[DIR] integrations
N/A
[DIR] profiler
N/A
__init__.py
1.17 KB
Rename
Delete
_compat.py
3.04 KB
Rename
Delete
_init_implementation.py
2.50 KB
Rename
Delete
_log_batcher.py
4.26 KB
Rename
Delete
_lru_cache.py
1.20 KB
Rename
Delete
_queue.py
10.99 KB
Rename
Delete
_types.py
9.64 KB
Rename
Delete
_werkzeug.py
3.65 KB
Rename
Delete
api.py
11.03 KB
Rename
Delete
attachments.py
3.04 KB
Rename
Delete
client.py
35.96 KB
Rename
Delete
consts.py
38.15 KB
Rename
Delete
debug.py
1.00 KB
Rename
Delete
envelope.py
10.27 KB
Rename
Delete
feature_flags.py
2.07 KB
Rename
Delete
hub.py
25.07 KB
Rename
Delete
logger.py
1.62 KB
Rename
Delete
metrics.py
29.21 KB
Rename
Delete
monitor.py
3.62 KB
Rename
Delete
py.typed
0 bytes
Rename
Delete
scope.py
61.10 KB
Rename
Delete
scrubber.py
5.81 KB
Rename
Delete
serializer.py
12.78 KB
Rename
Delete
session.py
5.44 KB
Rename
Delete
sessions.py
8.97 KB
Rename
Delete
spotlight.py
8.47 KB
Rename
Delete
tracing.py
46.07 KB
Rename
Delete
tracing_utils.py
28.05 KB
Rename
Delete
transport.py
31.45 KB
Rename
Delete
types.py
826 bytes
Rename
Delete
utils.py
57.98 KB
Rename
Delete
worker.py
4.36 KB
Rename
Delete
import sys from typing import TYPE_CHECKING if TYPE_CHECKING: from typing import Any from typing import TypeVar T = TypeVar("T") PY37 = sys.version_info[0] == 3 and sys.version_info[1] >= 7 PY38 = sys.version_info[0] == 3 and sys.version_info[1] >= 8 PY310 = sys.version_info[0] == 3 and sys.version_info[1] >= 10 PY311 = sys.version_info[0] == 3 and sys.version_info[1] >= 11 def with_metaclass(meta, *bases): # type: (Any, *Any) -> Any class MetaClass(type): def __new__(metacls, name, this_bases, d): # type: (Any, Any, Any, Any) -> Any return meta(name, bases, d) return type.__new__(MetaClass, "temporary_class", (), {}) def check_uwsgi_thread_support(): # type: () -> bool # We check two things here: # # 1. uWSGI doesn't run in threaded mode by default -- issue a warning if # that's the case. # # 2. Additionally, if uWSGI is running in preforking mode (default), it needs # the --py-call-uwsgi-fork-hooks option for the SDK to work properly. This # is because any background threads spawned before the main process is # forked are NOT CLEANED UP IN THE CHILDREN BY DEFAULT even if # --enable-threads is on. One has to explicitly provide # --py-call-uwsgi-fork-hooks to force uWSGI to run regular cpython # after-fork hooks that take care of cleaning up stale thread data. try: from uwsgi import opt # type: ignore except ImportError: return True from sentry_sdk.consts import FALSE_VALUES def enabled(option): # type: (str) -> bool value = opt.get(option, False) if isinstance(value, bool): return value if isinstance(value, bytes): try: value = value.decode() except Exception: pass return value and str(value).lower() not in FALSE_VALUES # When `threads` is passed in as a uwsgi option, # `enable-threads` is implied on. threads_enabled = "threads" in opt or enabled("enable-threads") fork_hooks_on = enabled("py-call-uwsgi-fork-hooks") lazy_mode = enabled("lazy-apps") or enabled("lazy") if lazy_mode and not threads_enabled: from warnings import warn warn( Warning( "IMPORTANT: " "We detected the use of uWSGI without thread support. " "This might lead to unexpected issues. " 'Please run uWSGI with "--enable-threads" for full support.' ) ) return False elif not lazy_mode and (not threads_enabled or not fork_hooks_on): from warnings import warn warn( Warning( "IMPORTANT: " "We detected the use of uWSGI in preforking mode without " "thread support. This might lead to crashing workers. " 'Please run uWSGI with both "--enable-threads" and ' '"--py-call-uwsgi-fork-hooks" for full support.' ) ) return False return True
Save