Skip to content

Commit aa57c9c

Browse files
committed
chore: sort imports w/ ruff.
1 parent ef43b54 commit aa57c9c

File tree

5 files changed

+19
-17
lines changed

5 files changed

+19
-17
lines changed

roundup/anypy/cgi_.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
# ruff: noqa: F401 - unused imports
12
try:
2-
# used for python2 and python 3 < 3.13
3-
import cgi as cgi
4-
from cgi import FieldStorage, MiniFieldStorage
3+
# used for python2 and python 3 < 3.13
4+
import cgi
5+
from cgi import FieldStorage, MiniFieldStorage
56
except ImportError:
6-
# use for python3 >= 3.13
7-
from roundup.anypy.vendored import cgi
8-
from roundup.anypy.vendored.cgi import FieldStorage, MiniFieldStorage
7+
# use for python3 >= 3.13
8+
from roundup.anypy.vendored import cgi
9+
from roundup.anypy.vendored.cgi import FieldStorage, MiniFieldStorage

roundup/anypy/cookie_.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
21
try:
32
# Python 3+
43
from http import cookies as Cookie
5-
from http.cookies import CookieError, BaseCookie, SimpleCookie
4+
from http.cookies import BaseCookie, CookieError, SimpleCookie
65
from http.cookies import _getdate as get_cookie_date
76
except ImportError:
7+
# ruff: noqa: F401, PLC2701
88
# Python 2.5-2.7
9-
from Cookie import CookieError, BaseCookie, SimpleCookie # noqa: F401
10-
from Cookie import _getdate as get_cookie_date # noqa: F401
9+
from Cookie import BaseCookie, CookieError, SimpleCookie
10+
from Cookie import _getdate as get_cookie_date

roundup/anypy/datetime_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# https://issues.roundup-tracker.org/issue2551278
22
# datetime.utcnow deprecated
33
try:
4-
from datetime import datetime, UTC
4+
from datetime import UTC, datetime
55

66
def utcnow():
77
return datetime.now(UTC)

roundup/anypy/ssl_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
from ssl import SSLError
44
except (ImportError, AttributeError):
55
# Python 2.5-2.7
6-
from socket import sslerror as SSLError # noqa: F401
6+
from socket import sslerror as SSLError # noqa: F401

roundup/anypy/urllib_.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11

22
try:
33
# Python 3+
4-
from urllib.parse import quote, unquote, urlencode, urlparse, parse_qs, \
5-
urlunparse
4+
from urllib.parse import parse_qs, quote, unquote, urlencode, \
5+
urlparse, urlunparse
66
from urllib.request import urlopen
77
except ImportError:
88
# Python 2.5-2.7
9-
from urllib import quote, unquote, urlencode # noqa: F401
10-
from urllib2 import urlopen # noqa: F401
11-
from urlparse import urlparse, parse_qs, urlunparse # noqa: F401
9+
from urllib import quote, unquote, urlencode # noqa: F401
10+
11+
from urllib2 import urlopen # noqa: F401
12+
from urlparse import parse_qs, urlparse, urlunparse # noqa: F401

0 commit comments

Comments
 (0)