<reponame>terrorizer1980/pyre-check
# flake8: noqa
from builtins import __test_sink, __test_source

from django.http import HttpRequest, HttpResponse


class ComplicatedService:
    def serve_tainted_request(self):
        return "Valid"


def test(complicated_service: ComplicatedService):
    exception = False
    result = None
    try:
        result = complicated_service.serve_tainted_request()

    except:
        exception = True

    # Only try reactivation if all other checks passed
    if exception:
        try:
            result = complicated_service.serve_tainted_request()
        except:
            raise

    __test_sink(result)


def test_none_clears_taint():
    x = __test_source()
    x = None
    __test_sink(x)

# flake8: noqa
from builtins import __test_sink, __test_source

from django.http import HttpRequest, HttpResponse


class ComplicatedService:
    def serve_tainted_request(self):
        return "Valid"


def test(complicated_service: ComplicatedService):
    exception = False
    result = None
    try:
        result = complicated_service.serve_tainted_request()

    except:
        exception = True

    # Only try reactivation if all other checks passed
    if exception:
        try:
            result = complicated_service.serve_tainted_request()
        except:
            raise

    __test_sink(result)


def test_none_clears_taint():
    x = __test_source()
    x = None
    __test_sink(x)
# flake8: noqa # Only try reactivation if all other checks passed