Skip to content

Commit

Permalink
Fix deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
keeprocking committed Jul 9, 2024
1 parent f8d51f8 commit 130680c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
Expand Down
3 changes: 2 additions & 1 deletion pygelf/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
except ImportError:
import http.client as httplib

from ssl import SSLContext
from logging.handlers import SocketHandler, DatagramHandler
from logging import Handler as LoggingHandler
from pygelf import gelf
Expand Down Expand Up @@ -126,7 +127,7 @@ def makeSocket(self, timeout=1):
if hasattr(plain_socket, 'settimeout'):
plain_socket.settimeout(timeout)

wrapped_socket = ssl.wrap_socket(plain_socket, ca_certs=self.ca_certs, cert_reqs=self.reqs,
wrapped_socket = SSLContext.wrap_socket(plain_socket, ca_certs=self.ca_certs, cert_reqs=self.reqs,
keyfile=self.keyfile, certfile=self.certfile)
wrapped_socket.connect((self.host, self.port))

Expand Down
2 changes: 1 addition & 1 deletion tests/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import requests


@pytest.yield_fixture
@pytest.fixture
def logger(handler):
logger = logging.getLogger('test')
logger.addHandler(handler)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dynamic_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def handler(request):
return request.param


@pytest.yield_fixture
@pytest.fixture
def logger(handler):
logger = logging.getLogger('test')
dummy_filter = DummyFilter()
Expand Down

0 comments on commit 130680c

Please sign in to comment.