Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions p4runtime_sh/global_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(self):
def reset(self):
"""Reset all options to their defaults."""
for option in Options:
assert(option in GlobalOptions.option_defaults)
assert option in GlobalOptions.option_defaults
self._values[option] = GlobalOptions.option_defaults[option]

def _supported_options_as_str(self):
Expand Down Expand Up @@ -102,7 +102,7 @@ def set(self, name, value):
option = Options[name]
except KeyError:
raise UnknownOptionName(name)
if type(value) != option.value:
if type(value) is not option.value:
raise InvalidOptionValueType(option, value)
self.set_option(option, value)

Expand Down
4 changes: 2 additions & 2 deletions p4runtime_sh/p4runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self, message):
# Used to iterate over the p4.Error messages in a gRPC error Status object
class P4RuntimeErrorIterator:
def __init__(self, grpc_error):
assert(grpc_error.code() == grpc.StatusCode.UNKNOWN)
assert grpc_error.code() == grpc.StatusCode.UNKNOWN
self.grpc_error = grpc_error

error = None
Expand Down Expand Up @@ -71,7 +71,7 @@ def __next__(self):
# documentation for more details on error-reporting.
class P4RuntimeWriteException(Exception):
def __init__(self, grpc_error):
assert(grpc_error.code() == grpc.StatusCode.UNKNOWN)
assert grpc_error.code() == grpc.StatusCode.UNKNOWN
super().__init__()
self.errors = []
try:
Expand Down
2 changes: 1 addition & 1 deletion p4runtime_sh/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ def msg(self):
return msg

def _from_msg(self, msg):
assert(self._action_id == msg.action_id)
assert self._action_id == msg.action_id
self._param_values.clear()
for p in msg.params:
p_name = context.get_param_name(self.action_name, p.param_id)
Expand Down
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
#
# SPDX-License-Identifier: Apache-2.0

flake8==3.8.4
nose2==0.9.2
flake8==7.4.1
nose2==0.16.0
callee==0.3.1
Loading