Skip to content

Commit 5c52ac0

Browse files
committed
apply non-automatic ruff fixes
1 parent d40c0a6 commit 5c52ac0

File tree

5 files changed

+19
-22
lines changed

5 files changed

+19
-22
lines changed

examples/errorhandling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def main():
131131
sys.exit(1)
132132

133133
# Catch the remaining exit errors
134-
except:
134+
except Exception:
135135
sys.exit(0)
136136

137137

examples/stickers.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,17 @@
2525

2626
#! /usr/bin/env python
2727

28-
# Edit these
29-
HOST = "localhost"
30-
PORT = 6600
31-
PASS = None
32-
33-
3428
from optparse import OptionParser
3529
from socket import error as SocketError
3630
from sys import stderr
3731

3832
from mpd import MPDClient, MPDError
3933

34+
# Edit these
35+
HOST = "localhost"
36+
PORT = 6600
37+
PASS = None
38+
4039

4140
ACTIONS = ("get", "set", "delete", "list", "find")
4241

mpd/__init__.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
# You should have received a copy of the GNU Lesser General Public License
1818
# along with python-mpd2. If not, see <http://www.gnu.org/licenses/>.
1919

20-
from mpd.base import CommandError
21-
from mpd.base import CommandListError
22-
from mpd.base import ConnectionError
23-
from mpd.base import FailureResponseCode
24-
from mpd.base import IteratingError
25-
from mpd.base import MPDClient
26-
from mpd.base import MPDError
27-
from mpd.base import PendingCommandError
28-
from mpd.base import ProtocolError
29-
from mpd.base import VERSION
20+
from mpd.base import CommandError as CommandError
21+
from mpd.base import CommandListError as CommandListError
22+
from mpd.base import ConnectionError as ConnectionError
23+
from mpd.base import FailureResponseCode as FailureResponseCode
24+
from mpd.base import IteratingError as IteratingError
25+
from mpd.base import MPDClient as MPDClient
26+
from mpd.base import MPDError as MPDError
27+
from mpd.base import PendingCommandError as PendingCommandError
28+
from mpd.base import ProtocolError as ProtocolError
29+
from mpd.base import VERSION as VERSION
3030

3131
try:
3232
from mpd.twisted import MPDProtocol

mpd/base.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import sys
2424
import warnings
2525
from enum import Enum
26+
from logging import NullHandler
2627
from typing import (
2728
IO,
2829
Any,
@@ -50,9 +51,6 @@
5051
def escape(text: str) -> str:
5152
return text.replace("\\", "\\\\").replace('"', '\\"')
5253

53-
54-
from logging import NullHandler
55-
5654
logger = logging.getLogger(__name__)
5755
logger.addHandler(NullHandler())
5856

mpd/tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,8 +1285,8 @@ def error(self, message: str) -> None:
12851285
def _feed(self) -> None:
12861286
if len(self._expectations[0][0]) == 0:
12871287
_, response_lines = self._expectations.pop(0)
1288-
for l in response_lines:
1289-
self._output.put_nowait(l)
1288+
for line in response_lines:
1289+
self._output.put_nowait(line)
12901290

12911291
def expect_exchange(
12921292
self, request_lines: List[bytes], response_lines: List[bytes]

0 commit comments

Comments
 (0)