Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issues raised by new Pylint version 2.9 #999

Merged
merged 1 commit into from
Jul 4, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Released: not yet
The function display_cim_objects(...) uses valuemapping_for_property() but
specifies the default namespace as the target. (See issue #995)

* Fixed issues raised by new Pylint version 2.9.

**Enhancements:**

**Cleanup:**
Expand Down
1 change: 1 addition & 0 deletions pywbemtools/pywbemcli/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
try:
from collections.abc import Sequence
except ImportError:
# pylint: disable=deprecated-class
from collections import Sequence

import six
Expand Down
5 changes: 5 additions & 0 deletions pywbemtools/pywbemlistener/_cmd_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,9 @@ def get_listeners(name=None):
args = parse_listener_args(listener_args)
if args:
if name is None or args.name == name:
# pylint: disable=no-member
# Note: This is a workaround for Pylint raising no-member on
# Python 3.9 (see issue #1001)
logfile = get_logfile(args.logdir, args.name)
lis = ListenerProperties(
name=args.name, port=args.port, scheme=args.scheme,
Expand All @@ -433,6 +436,8 @@ def get_listeners(name=None):
indi_file=args.indi_file, indi_format=args.indi_format,
logfile=logfile,
pid=p.pid, created=datetime.fromtimestamp(p.create_time()))
# pylint: enable=no-member
# Note: End of workaround
ret.append(lis)
return ret

Expand Down
3 changes: 2 additions & 1 deletion tests/unit/pywbemcli/test_pywbem_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,8 @@ def test_pysvr_connect_attrs(testcase, init_kwargs, exp_attrs):

# Create temp fake file.
# NOTE: We cannot use fixtures because we are using simplified_test_function
open(FAKE_PEM_PATH, 'a').close()
with open(FAKE_PEM_PATH, 'a'):
pass

# connect and test connection results. Try block insures finally is
# called.
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
try:
from collections.abc import Mapping, Sequence
except ImportError:
# pylint: disable=deprecated-class
from collections import Mapping, Sequence
try:
from StringIO import StringIO # Python 2
Expand Down Expand Up @@ -249,8 +250,7 @@ def execute_command(cmdname, args, env=None, stdin=None, verbose=False,
rc = proc.returncode

# Restore environment of current process
for name in saved_env:
value = saved_env[name]
for name, value in saved_env.items():
if value is None:
del os.environ[name]
else:
Expand Down