From a5b08b0ad1a5481ba828e4924961f341060cedb8 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Wed, 28 Feb 2024 20:06:48 +0900 Subject: [PATCH] drop code for Python 3.2 Signed-off-by: Inada Naoki --- fluent/handler.py | 9 ++------- tests/test_asynchandler.py | 7 ------- tests/test_handler.py | 7 ------- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/fluent/handler.py b/fluent/handler.py index 958af00..2bc42b4 100644 --- a/fluent/handler.py +++ b/fluent/handler.py @@ -1,11 +1,6 @@ +import json import logging import socket -import sys - -try: - import simplejson as json -except ImportError: # pragma: no cover - import json from fluent import sender @@ -42,7 +37,7 @@ def __init__( ): super().__init__(None, datefmt) - if sys.version_info[0:2] >= (3, 2) and style != "%": + if style != "%": self.__style, basic_fmt_dict = { "{": ( logging.StrFormatStyle, diff --git a/tests/test_asynchandler.py b/tests/test_asynchandler.py index ff64410..7bbf108 100644 --- a/tests/test_asynchandler.py +++ b/tests/test_asynchandler.py @@ -1,5 +1,4 @@ import logging -import sys import unittest try: @@ -81,9 +80,6 @@ def test_custom_fmt(self): self.assertTrue("lineno" in data[0][2]) self.assertTrue("emitted_at" in data[0][2]) - @unittest.skipUnless( - sys.version_info[0:2] >= (3, 2), "supported with Python 3.2 or above" - ) def test_custom_fmt_with_format_style(self): handler = self.get_handler_class()("app.follow", port=self._port) @@ -108,9 +104,6 @@ def test_custom_fmt_with_format_style(self): self.assertTrue("lineno" in data[0][2]) self.assertTrue("emitted_at" in data[0][2]) - @unittest.skipUnless( - sys.version_info[0:2] >= (3, 2), "supported with Python 3.2 or above" - ) def test_custom_fmt_with_template_style(self): handler = self.get_handler_class()("app.follow", port=self._port) diff --git a/tests/test_handler.py b/tests/test_handler.py index 05c3c56..711d282 100644 --- a/tests/test_handler.py +++ b/tests/test_handler.py @@ -1,5 +1,4 @@ import logging -import sys import unittest import fluent.handler @@ -139,9 +138,6 @@ def formatter(record): self.assertEqual(1234, data[0][2]["x"]) self.assertEqual(1, data[0][2]["custom_value"]) - @unittest.skipUnless( - sys.version_info[0:2] >= (3, 2), "supported with Python 3.2 or above" - ) def test_custom_fmt_with_format_style(self): handler = fluent.handler.FluentHandler("app.follow", port=self._port) @@ -167,9 +163,6 @@ def test_custom_fmt_with_format_style(self): self.assertTrue("lineno" in data[0][2]) self.assertTrue("emitted_at" in data[0][2]) - @unittest.skipUnless( - sys.version_info[0:2] >= (3, 2), "supported with Python 3.2 or above" - ) def test_custom_fmt_with_template_style(self): handler = fluent.handler.FluentHandler("app.follow", port=self._port)