Skip to content

Commit

Permalink
🎨 change syntax catch_warnings for compat old
Browse files Browse the repository at this point in the history
  • Loading branch information
Ousret committed Jan 13, 2025
1 parent 236f2d6 commit 3223bda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/urllib3/contrib/_socks_override.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,8 @@ async def connect(
# then we'll think on how to proceed.
# A) the maintainer agrees to revert https://github.com/romis2012/python-socks/commit/173a7390469c06aa033f8dca67c827854b462bc3#diff-e4086fa970d1c98b1eb341e58cb70e9ceffe7391b2feecc4b66c7e92ea2de76fR64
# B) the maintainer pursue the removal -> do we vendor our copy of python-socks? is there an alternative?
with warnings.catch_warnings(
action="ignore", category=DeprecationWarning
):
with warnings.catch_warnings():
warnings.simplefilter("ignore", DeprecationWarning)
return await self._connect(
dest_host=dest_host,
dest_port=dest_port,
Expand Down
5 changes: 2 additions & 3 deletions src/urllib3/contrib/socks.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,8 @@ def _new_conn(self) -> socket:
# then we'll think on how to proceed.
# A) the maintainer agrees to revert https://github.com/romis2012/python-socks/commit/173a7390469c06aa033f8dca67c827854b462bc3#diff-e4086fa970d1c98b1eb341e58cb70e9ceffe7391b2feecc4b66c7e92ea2de76fR64
# B) the maintainer pursue the removal -> do we vendor our copy of python-socks? is there an alternative?
with warnings.catch_warnings(
action="ignore", category=DeprecationWarning
):
with warnings.catch_warnings():
warnings.simplefilter("ignore", DeprecationWarning)
return p.connect(
self.host,
self.port,
Expand Down

0 comments on commit 3223bda

Please sign in to comment.