We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Send events without proxy  when http_proxy is configured as env variable
Hi,
I have problem with configuration of sentry_sdk. My code is behind corporate proxy and `http_proxy` is configured on machine as env variable (required when I want to install something via pip for example). Also I have env variable `no_proxy` where I added ip address for host where sentry is working (this ip is inside corporate network). When I try send event to sentry I got return code 403 (proxy refuse request). Probably sentry_sdk automacally fetch proxy from http_proxy env but ignore no_proxy. When I remove http_proxy from env everything is working. How can I configure python_sdk to ignore my http_proxy env variable? My code: 

```
import logging
import sentry_sdk
from sentry_sdk.integrations.logging import LoggingIntegration


sentry_logging = LoggingIntegration(
    level=logging.INFO,       
    event_level=logging.ERROR 
)
sentry_sdk.init(
    dsn="<dsn>",
    integrations=[sentry_logging],
    debug=True,
)
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `sentry_sdk/transport.py`
Content:
```
1 from __future__ import print_function
2 
3 import json
4 import io
5 import urllib3  # type: ignore
6 import certifi
7 import gzip
8 
9 from datetime import datetime, timedelta
10 
11 from sentry_sdk.consts import VERSION
12 from sentry_sdk.utils import Dsn, logger, capture_internal_exceptions
13 from sentry_sdk.worker import BackgroundWorker
14 
15 if False:
16     from sentry_sdk.consts import ClientOptions
17     from typing import Type
18     from typing import Any
19     from typing import Optional
20     from typing import Dict
21     from typing import Union
22     from typing import Callable
23     from urllib3.poolmanager import PoolManager  # type: ignore
24     from urllib3.poolmanager import ProxyManager  # type: ignore
25 
26 try:
27     from urllib.request import getproxies
28 except ImportError:
29     from urllib import getproxies  # type: ignore
30 
31 
32 class Transport(object):
33     """Baseclass for all transports.
34 
35     A transport is used to send an event to sentry.
36     """
37 
38     parsed_dsn = None  # type: Dsn
39 
40     def __init__(self, options=None):
41         # type: (Optional[ClientOptions]) -> None
42         self.options = options
43         if options and options["dsn"]:
44             self.parsed_dsn = Dsn(options["dsn"])
45         else:
46             self.parsed_dsn = None  # type: ignore
47 
48     def capture_event(self, event):
49         """This gets invoked with the event dictionary when an event should
50         be sent to sentry.
51         """
52         raise NotImplementedError()
53 
54     def flush(self, timeout, callback=None):
55         """Wait `timeout` seconds for the current events to be sent out."""
56         pass
57 
58     def kill(self):
59         # type: () -> None
60         """Forcefully kills the transport."""
61         pass
62 
63     def __del__(self):
64         # type: () -> None
65         try:
66             self.kill()
67         except Exception:
68             pass
69 
70 
71 class HttpTransport(Transport):
72     """The default HTTP transport."""
73 
74     def __init__(self, options):
75         # type: (ClientOptions) -> None
76         Transport.__init__(self, options)
77         self._worker = BackgroundWorker()
78         self._auth = self.parsed_dsn.to_auth("sentry.python/%s" % VERSION)
79         self._disabled_until = None  # type: Optional[datetime]
80         self._retry = urllib3.util.Retry()
81         self.options = options
82 
83         self._pool = self._make_pool(
84             self.parsed_dsn,
85             http_proxy=options["http_proxy"],
86             https_proxy=options["https_proxy"],
87             ca_certs=options["ca_certs"],
88         )
89 
90         from sentry_sdk import Hub
91 
92         self.hub_cls = Hub
93 
94     def _send_event(self, event):
95         # type: (Dict[str, Any]) -> None
96         if self._disabled_until is not None:
97             if datetime.utcnow() < self._disabled_until:
98                 return
99             self._disabled_until = None
100 
101         body = io.BytesIO()
102         with gzip.GzipFile(fileobj=body, mode="w") as f:
103             f.write(json.dumps(event, allow_nan=False).encode("utf-8"))
104 
105         logger.debug(
106             "Sending %s event [%s] to %s project:%s"
107             % (
108                 event.get("level") or "error",
109                 event["event_id"],
110                 self.parsed_dsn.host,
111                 self.parsed_dsn.project_id,
112             )
113         )
114         response = self._pool.request(
115             "POST",
116             str(self._auth.store_api_url),
117             body=body.getvalue(),
118             headers={
119                 "X-Sentry-Auth": str(self._auth.to_header()),
120                 "Content-Type": "application/json",
121                 "Content-Encoding": "gzip",
122             },
123         )
124 
125         try:
126             if response.status == 429:
127                 self._disabled_until = datetime.utcnow() + timedelta(
128                     seconds=self._retry.get_retry_after(response) or 60
129                 )
130                 return
131 
132             elif response.status >= 300 or response.status < 200:
133                 logger.error(
134                     "Unexpected status code: %s (body: %s)",
135                     response.status,
136                     response.data,
137                 )
138         finally:
139             response.close()
140 
141         self._disabled_until = None
142 
143     def _get_pool_options(self, ca_certs):
144         # type: (Optional[Any]) -> Dict[str, Any]
145         return {
146             "num_pools": 2,
147             "cert_reqs": "CERT_REQUIRED",
148             "ca_certs": ca_certs or certifi.where(),
149         }
150 
151     def _make_pool(
152         self,
153         parsed_dsn,  # type: Dsn
154         http_proxy,  # type: Optional[str]
155         https_proxy,  # type: Optional[str]
156         ca_certs,  # type: Optional[Any]
157     ):
158         # type: (...) -> Union[PoolManager, ProxyManager]
159         # Use http_proxy if scheme is https and https_proxy is not set
160         proxy = parsed_dsn.scheme == "https" and https_proxy or http_proxy
161         if not proxy:
162             proxy = getproxies().get(parsed_dsn.scheme)
163 
164         opts = self._get_pool_options(ca_certs)
165 
166         if proxy:
167             return urllib3.ProxyManager(proxy, **opts)
168         else:
169             return urllib3.PoolManager(**opts)
170 
171     def capture_event(self, event):
172         # type: (Dict[str, Any]) -> None
173         hub = self.hub_cls.current
174 
175         def send_event_wrapper():
176             # type: () -> None
177             with hub:
178                 with capture_internal_exceptions():
179                     self._send_event(event)
180 
181         self._worker.submit(send_event_wrapper)
182 
183     def flush(self, timeout, callback=None):
184         # type: (float, Optional[Any]) -> None
185         logger.debug("Flushing HTTP transport")
186         if timeout > 0:
187             self._worker.flush(timeout, callback)
188 
189     def kill(self):
190         # type: () -> None
191         logger.debug("Killing HTTP transport")
192         self._worker.kill()
193 
194 
195 class _FunctionTransport(Transport):
196     def __init__(self, func):
197         # type: (Callable[[Dict[str, Any]], None]) -> None
198         Transport.__init__(self)
199         self._func = func
200 
201     def capture_event(self, event):
202         # type: (Dict[str, Any]) -> None
203         self._func(event)
204         return None
205 
206 
207 def make_transport(options):
208     # type: (ClientOptions) -> Optional[Transport]
209     ref_transport = options["transport"]
210 
211     # If no transport is given, we use the http transport class
212     if ref_transport is None:
213         transport_cls = HttpTransport  # type: Type[Transport]
214     else:
215         try:
216             issubclass(ref_transport, type)  # type: ignore
217         except TypeError:
218             # if we are not a class but we are a callable, assume a
219             # function that acts as capture_event
220             if callable(ref_transport):
221                 return _FunctionTransport(ref_transport)
222             # otherwise assume an object fulfilling the transport contract
223             return ref_transport
224         transport_cls = ref_transport  # type: ignore
225 
226     # if a transport class is given only instanciate it if the dsn is not
227     # empty or None
228     if options["dsn"]:
229         return transport_cls(options)
230 
231     return None
232
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/sentry_sdk/transport.py b/sentry_sdk/transport.py
--- a/sentry_sdk/transport.py
+++ b/sentry_sdk/transport.py
@@ -156,10 +156,15 @@
         ca_certs,  # type: Optional[Any]
     ):
         # type: (...) -> Union[PoolManager, ProxyManager]
-        # Use http_proxy if scheme is https and https_proxy is not set
-        proxy = parsed_dsn.scheme == "https" and https_proxy or http_proxy
-        if not proxy:
-            proxy = getproxies().get(parsed_dsn.scheme)
+        proxy = None
+
+        # try HTTPS first
+        if parsed_dsn.scheme == "https" and (https_proxy != ""):
+            proxy = https_proxy or getproxies().get("https")
+
+        # maybe fallback to HTTP proxy
+        if not proxy and (http_proxy != ""):
+            proxy = http_proxy or getproxies().get("http")
 
         opts = self._get_pool_options(ca_certs)

{"golden_diff": "diff --git a/sentry_sdk/transport.py b/sentry_sdk/transport.py\n--- a/sentry_sdk/transport.py\n+++ b/sentry_sdk/transport.py\n@@ -156,10 +156,15 @@\n         ca_certs,  # type: Optional[Any]\n     ):\n         # type: (...) -> Union[PoolManager, ProxyManager]\n-        # Use http_proxy if scheme is https and https_proxy is not set\n-        proxy = parsed_dsn.scheme == \"https\" and https_proxy or http_proxy\n-        if not proxy:\n-            proxy = getproxies().get(parsed_dsn.scheme)\n+        proxy = None\n+\n+        # try HTTPS first\n+        if parsed_dsn.scheme == \"https\" and (https_proxy != \"\"):\n+            proxy = https_proxy or getproxies().get(\"https\")\n+\n+        # maybe fallback to HTTP proxy\n+        if not proxy and (http_proxy != \"\"):\n+            proxy = http_proxy or getproxies().get(\"http\")\n \n         opts = self._get_pool_options(ca_certs)\n", "issue": "Send events without proxy  when http_proxy is configured as env variable\nHi,\r\nI have problem with configuration of sentry_sdk. My code is behind corporate proxy and `http_proxy` is configured on machine as env variable (required when I want to install something via pip for example). Also I have env variable `no_proxy` where I added ip address for host where sentry is working (this ip is inside corporate network). When I try send event to sentry I got return code 403 (proxy refuse request). Probably sentry_sdk automacally fetch proxy from http_proxy env but ignore no_proxy. When I remove http_proxy from env everything is working. How can I configure python_sdk to ignore my http_proxy env variable? My code: \r\n\r\n```\r\nimport logging\r\nimport sentry_sdk\r\nfrom sentry_sdk.integrations.logging import LoggingIntegration\r\n\r\n\r\nsentry_logging = LoggingIntegration(\r\n    level=logging.INFO,       \r\n    event_level=logging.ERROR \r\n)\r\nsentry_sdk.init(\r\n    dsn=\"<dsn>\",\r\n    integrations=[sentry_logging],\r\n    debug=True,\r\n)\r\n```\n", "before_files": [{"content": "from __future__ import print_function\n\nimport json\nimport io\nimport urllib3  # type: ignore\nimport certifi\nimport gzip\n\nfrom datetime import datetime, timedelta\n\nfrom sentry_sdk.consts import VERSION\nfrom sentry_sdk.utils import Dsn, logger, capture_internal_exceptions\nfrom sentry_sdk.worker import BackgroundWorker\n\nif False:\n    from sentry_sdk.consts import ClientOptions\n    from typing import Type\n    from typing import Any\n    from typing import Optional\n    from typing import Dict\n    from typing import Union\n    from typing import Callable\n    from urllib3.poolmanager import PoolManager  # type: ignore\n    from urllib3.poolmanager import ProxyManager  # type: ignore\n\ntry:\n    from urllib.request import getproxies\nexcept ImportError:\n    from urllib import getproxies  # type: ignore\n\n\nclass Transport(object):\n    \"\"\"Baseclass for all transports.\n\n    A transport is used to send an event to sentry.\n    \"\"\"\n\n    parsed_dsn = None  # type: Dsn\n\n    def __init__(self, options=None):\n        # type: (Optional[ClientOptions]) -> None\n        self.options = options\n        if options and options[\"dsn\"]:\n            self.parsed_dsn = Dsn(options[\"dsn\"])\n        else:\n            self.parsed_dsn = None  # type: ignore\n\n    def capture_event(self, event):\n        \"\"\"This gets invoked with the event dictionary when an event should\n        be sent to sentry.\n        \"\"\"\n        raise NotImplementedError()\n\n    def flush(self, timeout, callback=None):\n        \"\"\"Wait `timeout` seconds for the current events to be sent out.\"\"\"\n        pass\n\n    def kill(self):\n        # type: () -> None\n        \"\"\"Forcefully kills the transport.\"\"\"\n        pass\n\n    def __del__(self):\n        # type: () -> None\n        try:\n            self.kill()\n        except Exception:\n            pass\n\n\nclass HttpTransport(Transport):\n    \"\"\"The default HTTP transport.\"\"\"\n\n    def __init__(self, options):\n        # type: (ClientOptions) -> None\n        Transport.__init__(self, options)\n        self._worker = BackgroundWorker()\n        self._auth = self.parsed_dsn.to_auth(\"sentry.python/%s\" % VERSION)\n        self._disabled_until = None  # type: Optional[datetime]\n        self._retry = urllib3.util.Retry()\n        self.options = options\n\n        self._pool = self._make_pool(\n            self.parsed_dsn,\n            http_proxy=options[\"http_proxy\"],\n            https_proxy=options[\"https_proxy\"],\n            ca_certs=options[\"ca_certs\"],\n        )\n\n        from sentry_sdk import Hub\n\n        self.hub_cls = Hub\n\n    def _send_event(self, event):\n        # type: (Dict[str, Any]) -> None\n        if self._disabled_until is not None:\n            if datetime.utcnow() < self._disabled_until:\n                return\n            self._disabled_until = None\n\n        body = io.BytesIO()\n        with gzip.GzipFile(fileobj=body, mode=\"w\") as f:\n            f.write(json.dumps(event, allow_nan=False).encode(\"utf-8\"))\n\n        logger.debug(\n            \"Sending %s event [%s] to %s project:%s\"\n            % (\n                event.get(\"level\") or \"error\",\n                event[\"event_id\"],\n                self.parsed_dsn.host,\n                self.parsed_dsn.project_id,\n            )\n        )\n        response = self._pool.request(\n            \"POST\",\n            str(self._auth.store_api_url),\n            body=body.getvalue(),\n            headers={\n                \"X-Sentry-Auth\": str(self._auth.to_header()),\n                \"Content-Type\": \"application/json\",\n                \"Content-Encoding\": \"gzip\",\n            },\n        )\n\n        try:\n            if response.status == 429:\n                self._disabled_until = datetime.utcnow() + timedelta(\n                    seconds=self._retry.get_retry_after(response) or 60\n                )\n                return\n\n            elif response.status >= 300 or response.status < 200:\n                logger.error(\n                    \"Unexpected status code: %s (body: %s)\",\n                    response.status,\n                    response.data,\n                )\n        finally:\n            response.close()\n\n        self._disabled_until = None\n\n    def _get_pool_options(self, ca_certs):\n        # type: (Optional[Any]) -> Dict[str, Any]\n        return {\n            \"num_pools\": 2,\n            \"cert_reqs\": \"CERT_REQUIRED\",\n            \"ca_certs\": ca_certs or certifi.where(),\n        }\n\n    def _make_pool(\n        self,\n        parsed_dsn,  # type: Dsn\n        http_proxy,  # type: Optional[str]\n        https_proxy,  # type: Optional[str]\n        ca_certs,  # type: Optional[Any]\n    ):\n        # type: (...) -> Union[PoolManager, ProxyManager]\n        # Use http_proxy if scheme is https and https_proxy is not set\n        proxy = parsed_dsn.scheme == \"https\" and https_proxy or http_proxy\n        if not proxy:\n            proxy = getproxies().get(parsed_dsn.scheme)\n\n        opts = self._get_pool_options(ca_certs)\n\n        if proxy:\n            return urllib3.ProxyManager(proxy, **opts)\n        else:\n            return urllib3.PoolManager(**opts)\n\n    def capture_event(self, event):\n        # type: (Dict[str, Any]) -> None\n        hub = self.hub_cls.current\n\n        def send_event_wrapper():\n            # type: () -> None\n            with hub:\n                with capture_internal_exceptions():\n                    self._send_event(event)\n\n        self._worker.submit(send_event_wrapper)\n\n    def flush(self, timeout, callback=None):\n        # type: (float, Optional[Any]) -> None\n        logger.debug(\"Flushing HTTP transport\")\n        if timeout > 0:\n            self._worker.flush(timeout, callback)\n\n    def kill(self):\n        # type: () -> None\n        logger.debug(\"Killing HTTP transport\")\n        self._worker.kill()\n\n\nclass _FunctionTransport(Transport):\n    def __init__(self, func):\n        # type: (Callable[[Dict[str, Any]], None]) -> None\n        Transport.__init__(self)\n        self._func = func\n\n    def capture_event(self, event):\n        # type: (Dict[str, Any]) -> None\n        self._func(event)\n        return None\n\n\ndef make_transport(options):\n    # type: (ClientOptions) -> Optional[Transport]\n    ref_transport = options[\"transport\"]\n\n    # If no transport is given, we use the http transport class\n    if ref_transport is None:\n        transport_cls = HttpTransport  # type: Type[Transport]\n    else:\n        try:\n            issubclass(ref_transport, type)  # type: ignore\n        except TypeError:\n            # if we are not a class but we are a callable, assume a\n            # function that acts as capture_event\n            if callable(ref_transport):\n                return _FunctionTransport(ref_transport)\n            # otherwise assume an object fulfilling the transport contract\n            return ref_transport\n        transport_cls = ref_transport  # type: ignore\n\n    # if a transport class is given only instanciate it if the dsn is not\n    # empty or None\n    if options[\"dsn\"]:\n        return transport_cls(options)\n\n    return None\n", "path": "sentry_sdk/transport.py"}], "after_files": [{"content": "from __future__ import print_function\n\nimport json\nimport io\nimport urllib3  # type: ignore\nimport certifi\nimport gzip\n\nfrom datetime import datetime, timedelta\n\nfrom sentry_sdk.consts import VERSION\nfrom sentry_sdk.utils import Dsn, logger, capture_internal_exceptions\nfrom sentry_sdk.worker import BackgroundWorker\n\nif False:\n    from sentry_sdk.consts import ClientOptions\n    from typing import Type\n    from typing import Any\n    from typing import Optional\n    from typing import Dict\n    from typing import Union\n    from typing import Callable\n    from urllib3.poolmanager import PoolManager  # type: ignore\n    from urllib3.poolmanager import ProxyManager  # type: ignore\n\ntry:\n    from urllib.request import getproxies\nexcept ImportError:\n    from urllib import getproxies  # type: ignore\n\n\nclass Transport(object):\n    \"\"\"Baseclass for all transports.\n\n    A transport is used to send an event to sentry.\n    \"\"\"\n\n    parsed_dsn = None  # type: Dsn\n\n    def __init__(self, options=None):\n        # type: (Optional[ClientOptions]) -> None\n        self.options = options\n        if options and options[\"dsn\"]:\n            self.parsed_dsn = Dsn(options[\"dsn\"])\n        else:\n            self.parsed_dsn = None  # type: ignore\n\n    def capture_event(self, event):\n        \"\"\"This gets invoked with the event dictionary when an event should\n        be sent to sentry.\n        \"\"\"\n        raise NotImplementedError()\n\n    def flush(self, timeout, callback=None):\n        \"\"\"Wait `timeout` seconds for the current events to be sent out.\"\"\"\n        pass\n\n    def kill(self):\n        # type: () -> None\n        \"\"\"Forcefully kills the transport.\"\"\"\n        pass\n\n    def __del__(self):\n        # type: () -> None\n        try:\n            self.kill()\n        except Exception:\n            pass\n\n\nclass HttpTransport(Transport):\n    \"\"\"The default HTTP transport.\"\"\"\n\n    def __init__(self, options):\n        # type: (ClientOptions) -> None\n        Transport.__init__(self, options)\n        self._worker = BackgroundWorker()\n        self._auth = self.parsed_dsn.to_auth(\"sentry.python/%s\" % VERSION)\n        self._disabled_until = None  # type: Optional[datetime]\n        self._retry = urllib3.util.Retry()\n        self.options = options\n\n        self._pool = self._make_pool(\n            self.parsed_dsn,\n            http_proxy=options[\"http_proxy\"],\n            https_proxy=options[\"https_proxy\"],\n            ca_certs=options[\"ca_certs\"],\n        )\n\n        from sentry_sdk import Hub\n\n        self.hub_cls = Hub\n\n    def _send_event(self, event):\n        # type: (Dict[str, Any]) -> None\n        if self._disabled_until is not None:\n            if datetime.utcnow() < self._disabled_until:\n                return\n            self._disabled_until = None\n\n        body = io.BytesIO()\n        with gzip.GzipFile(fileobj=body, mode=\"w\") as f:\n            f.write(json.dumps(event, allow_nan=False).encode(\"utf-8\"))\n\n        logger.debug(\n            \"Sending %s event [%s] to %s project:%s\"\n            % (\n                event.get(\"level\") or \"error\",\n                event[\"event_id\"],\n                self.parsed_dsn.host,\n                self.parsed_dsn.project_id,\n            )\n        )\n        response = self._pool.request(\n            \"POST\",\n            str(self._auth.store_api_url),\n            body=body.getvalue(),\n            headers={\n                \"X-Sentry-Auth\": str(self._auth.to_header()),\n                \"Content-Type\": \"application/json\",\n                \"Content-Encoding\": \"gzip\",\n            },\n        )\n\n        try:\n            if response.status == 429:\n                self._disabled_until = datetime.utcnow() + timedelta(\n                    seconds=self._retry.get_retry_after(response) or 60\n                )\n                return\n\n            elif response.status >= 300 or response.status < 200:\n                logger.error(\n                    \"Unexpected status code: %s (body: %s)\",\n                    response.status,\n                    response.data,\n                )\n        finally:\n            response.close()\n\n        self._disabled_until = None\n\n    def _get_pool_options(self, ca_certs):\n        # type: (Optional[Any]) -> Dict[str, Any]\n        return {\n            \"num_pools\": 2,\n            \"cert_reqs\": \"CERT_REQUIRED\",\n            \"ca_certs\": ca_certs or certifi.where(),\n        }\n\n    def _make_pool(\n        self,\n        parsed_dsn,  # type: Dsn\n        http_proxy,  # type: Optional[str]\n        https_proxy,  # type: Optional[str]\n        ca_certs,  # type: Optional[Any]\n    ):\n        # type: (...) -> Union[PoolManager, ProxyManager]\n        proxy = None\n\n        # try HTTPS first\n        if parsed_dsn.scheme == \"https\" and (https_proxy != \"\"):\n            proxy = https_proxy or getproxies().get(\"https\")\n\n        # maybe fallback to HTTP proxy\n        if not proxy and (http_proxy != \"\"):\n            proxy = http_proxy or getproxies().get(\"http\")\n\n        opts = self._get_pool_options(ca_certs)\n\n        if proxy:\n            return urllib3.ProxyManager(proxy, **opts)\n        else:\n            return urllib3.PoolManager(**opts)\n\n    def capture_event(self, event):\n        # type: (Dict[str, Any]) -> None\n        hub = self.hub_cls.current\n\n        def send_event_wrapper():\n            # type: () -> None\n            with hub:\n                with capture_internal_exceptions():\n                    self._send_event(event)\n\n        self._worker.submit(send_event_wrapper)\n\n    def flush(self, timeout, callback=None):\n        # type: (float, Optional[Any]) -> None\n        logger.debug(\"Flushing HTTP transport\")\n        if timeout > 0:\n            self._worker.flush(timeout, callback)\n\n    def kill(self):\n        # type: () -> None\n        logger.debug(\"Killing HTTP transport\")\n        self._worker.kill()\n\n\nclass _FunctionTransport(Transport):\n    def __init__(self, func):\n        # type: (Callable[[Dict[str, Any]], None]) -> None\n        Transport.__init__(self)\n        self._func = func\n\n    def capture_event(self, event):\n        # type: (Dict[str, Any]) -> None\n        self._func(event)\n        return None\n\n\ndef make_transport(options):\n    # type: (ClientOptions) -> Optional[Transport]\n    ref_transport = options[\"transport\"]\n\n    # If no transport is given, we use the http transport class\n    if ref_transport is None:\n        transport_cls = HttpTransport  # type: Type[Transport]\n    else:\n        try:\n            issubclass(ref_transport, type)  # type: ignore\n        except TypeError:\n            # if we are not a class but we are a callable, assume a\n            # function that acts as capture_event\n            if callable(ref_transport):\n                return _FunctionTransport(ref_transport)\n            # otherwise assume an object fulfilling the transport contract\n            return ref_transport\n        transport_cls = ref_transport  # type: ignore\n\n    # if a transport class is given only instanciate it if the dsn is not\n    # empty or None\n    if options[\"dsn\"]:\n        return transport_cls(options)\n\n    return None\n", "path": "sentry_sdk/transport.py"}]}