Skip to content

Commit a3fac4e

Browse files
A suppression of E721 is removed (#28)
* [E721] ... is int * [E721] ... is str * [E721] ... is bool * [E721] ... is dict * [E721] ... is list * [E721] ... is bytes * [E721] ... is tuple * [E721] ... is set * [E721] mix
1 parent 3a47638 commit a3fac4e

File tree

10 files changed

+250
-250
lines changed

10 files changed

+250
-250
lines changed

src/exceptions.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ def __init__(
2626
out: typing.Optional[T_OUT_DATA] = None,
2727
error: typing.Optional[T_ERR_DATA] = None,
2828
):
29-
assert message is None or type(message) == str # noqa: E721
30-
assert command is None or type(command) in [str, list] # noqa: E721
31-
assert exit_code is None or type(exit_code) == int # noqa: E721
32-
assert out is None or type(out) in [str, bytes] # noqa: E721
33-
assert error is None or type(error) in [str, bytes] # noqa: E721
29+
assert message is None or type(message) is str
30+
assert command is None or type(command) in [str, list]
31+
assert exit_code is None or type(exit_code) is int
32+
assert out is None or type(out) in [str, bytes]
33+
assert error is None or type(error) in [str, bytes]
3434

3535
super().__init__(message)
3636

@@ -61,32 +61,32 @@ def message(self) -> str:
6161
msg.append(u'---- Out:\n{}'.format(self.out))
6262

6363
r = self.convert_and_join(msg)
64-
assert type(r) == str # noqa: E721
64+
assert type(r) is str
6565
return r
6666

6767
@property
6868
def description(self) -> typing.Optional[str]:
69-
assert self._description is None or type(self._description) == str # noqa: E721
69+
assert self._description is None or type(self._description) is str
7070
return self._description
7171

7272
@property
7373
def command(self) -> typing.Optional[T_CMD]:
74-
assert self._command is None or type(self._command) in [str, list] # noqa: E721
74+
assert self._command is None or type(self._command) in [str, list]
7575
return self._command
7676

7777
@property
7878
def exit_code(self) -> typing.Optional[int]:
79-
assert self._exit_code is None or type(self._exit_code) == int # noqa: E721
79+
assert self._exit_code is None or type(self._exit_code) is int
8080
return self._exit_code
8181

8282
@property
8383
def out(self) -> typing.Optional[T_OUT_DATA]:
84-
assert self._out is None or type(self._out) in [str, bytes] # noqa: E721
84+
assert self._out is None or type(self._out) in [str, bytes]
8585
return self._out
8686

8787
@property
8888
def error(self) -> typing.Optional[T_ERR_DATA]:
89-
assert self._error is None or type(self._error) in [str, bytes] # noqa: E721
89+
assert self._error is None or type(self._error) in [str, bytes]
9090
return self._error
9191

9292
def __repr__(self) -> str:

src/helpers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def GetDefaultEncoding():
3131

3232
if r:
3333
assert r is not None
34-
assert type(r) == str # noqa: E721
34+
assert type(r) is str
3535
assert r != ""
3636
return r
3737

@@ -43,13 +43,13 @@ def PrepareProcessInput(input, encoding):
4343
if not input:
4444
return None
4545

46-
if type(input) == str: # noqa: E721
46+
if type(input) is str:
4747
if encoding is None:
4848
return input.encode(__class__.GetDefaultEncoding())
4949

50-
assert type(encoding) == str # noqa: E721
50+
assert type(encoding) is str
5151
return input.encode(encoding)
5252

5353
# It is expected!
54-
assert type(input) == bytes # noqa: E721
54+
assert type(input) is bytes
5555
return input

0 commit comments

Comments
 (0)