Projet

Général

Profil

0001-misc-disable-sentry-in-runscript-on-a-tty-47708.patch

Benjamin Dauvergne, 15 octobre 2020 10:39

Télécharger (1,24 ko)

Voir les différences:

Subject: [PATCH] misc: disable sentry in runscript on a tty (#47708)

 hobo/multitenant/management/commands/runscript.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
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
-