0001-misc-disable-sentry-in-runscript-on-a-tty-47708.patch
hobo/multitenant/management/commands/runscript.py | ||
---|---|---|
21 | 21 | |
22 | 22 |
from django.core.management.base import BaseCommand |
23 | 23 | |
24 |
class Command(BaseCommand): |
|
25 | 24 | |
25 |
class Command(BaseCommand): |
|
26 | 26 |
def add_arguments(self, parser): |
27 | 27 |
parser.add_argument('args', nargs=argparse.REMAINDER) |
28 | 28 | |
29 | 29 |
def handle(self, *args, **options): |
30 |
# if sentry is loaded and we are on a tty, disable it |
|
31 |
if 'sentry_sdk' in sys.modules and self.stdout.isatty(): |
|
32 |
import sentry_sdk |
|
33 |
sentry_sdk.init() |
|
30 | 34 |
fullpath = os.path.dirname(os.path.abspath(args[0])) |
31 | 35 |
sys.path.insert(0, fullpath) |
32 | 36 |
module_name = os.path.splitext(os.path.basename(args[0]))[0] |
33 |
- |