Skip to content

Commit fdaf1ff

Browse files
Remove use of six (#1525)
Now that the minimum supported version of Python is 3.9, and Python 2 has been removed, also remove the use of six, since it isn't needed to maintain compatibility.
1 parent b3f6d77 commit fdaf1ff

File tree

8 files changed

+8
-35
lines changed

8 files changed

+8
-35
lines changed

atlassian/bitbucket/cloud/repositories/deploymentEnvironments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from ..base import BitbucketCloudBase
44

5-
from six.moves.urllib.parse import urlunsplit, urlsplit
5+
from urllib.parse import urlunsplit, urlsplit
66

77

88
class DeploymentEnvironments(BitbucketCloudBase):

atlassian/request_utils.py

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,14 @@
11
import logging
22

3-
from six import PY3
4-
5-
6-
# Additional log methods
7-
def logger_has_handlers(logger):
8-
"""Since Python 2 doesn't provide Logger.hasHandlers(), we have to
9-
perform the lookup by ourselves."""
10-
11-
if PY3:
12-
return logger.hasHandlers()
13-
else:
14-
c = logger
15-
rv = False
16-
while c:
17-
if c.handlers:
18-
rv = True
19-
break
20-
if not c.propagate:
21-
break
22-
else:
23-
c = c.parent
24-
return rv
25-
263

274
def get_default_logger(name):
285
"""Get a logger from default logging manager. If no handler
296
is associated, add a default NullHandler"""
307

318
logger = logging.getLogger(name)
32-
if not logger_has_handlers(logger):
9+
if not logger.hasHandlers():
3310
# If logging is not configured in the current project, configure
34-
# this logger to discard all logs messages. This will prevent
35-
# the 'No handlers could be found for logger XXX' error on Python 2,
36-
# and avoid redirecting errors to the default 'lastResort'
37-
# StreamHandler on Python 3
11+
# this logger to discard all logs messages. This will avoid
12+
# redirecting errors to the default 'lastResort' StreamHandler
3813
logger.addHandler(logging.NullHandler())
3914
return logger

atlassian/rest_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
Union,
1313
overload,
1414
)
15+
from urllib.parse import urlencode
1516

1617
import requests
1718
import urllib3
@@ -27,7 +28,6 @@
2728

2829
from requests import HTTPError, Response, Session
2930
from requests_oauthlib import OAuth1, OAuth2
30-
from six.moves.urllib.parse import urlencode
3131
from typing_extensions import Self
3232
from urllib3.util import Retry
3333

examples/jira/jira_project_leaders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# coding=utf-8
22

3-
from six.moves.urllib.parse import quote
3+
from urllib.parse import quote
44

55
from atlassian import Jira
66

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ init-import = 'no'
330330

331331
# List of qualified module names which can have objects that can redefine
332332
# builtins.
333-
redefining-builtins-modules = 'six.moves,past.builtins,future.builtins,builtins,io'
333+
redefining-builtins-modules = 'past.builtins,future.builtins,builtins,io'
334334

335335

336336
[tool.pylint.FORMAT]

requirements-dev.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ mypy>=0.812
1515
doc8
1616
types-Deprecated
1717
types-requests
18-
types-six
1918
types-beautifulsoup4
2019
types-jmespath
2120
types-oauthlib

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Deprecated
22
requests>=2.8.1
3-
six
43
oauthlib
54
requests-oauthlib
65
requests-kerberos==0.14.0

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
package_dir={"atlassian": "atlassian"},
2727
include_package_data=True,
2828
zip_safe=False,
29-
install_requires=["deprecated", "requests", "six", "oauthlib", "requests_oauthlib", "jmespath", "beautifulsoup4", "typing-extensions"],
29+
install_requires=["deprecated", "requests", "oauthlib", "requests_oauthlib", "jmespath", "beautifulsoup4", "typing-extensions"],
3030
extras_require={"kerberos": ["requests-kerberos"]},
3131
platforms="Platform Independent",
3232
classifiers=[

0 commit comments

Comments
 (0)