Skip to content

Commit

Permalink
Adjusts imports for collections deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
lorengordon committed May 12, 2023
1 parent dd54c40 commit 78b933b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions _modules/win_lgpo_ash.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from __future__ import (absolute_import, division, print_function,
unicode_literals, with_statement)

import collections
import logging
import io
import os
Expand All @@ -28,6 +27,11 @@
from salt.exceptions import CommandExecutionError, SaltInvocationError
from salt.modules.win_lgpo import HAS_WINDOWS_MODULES

try:
from collections.abc import Sequence, Mapping
except ImportError:
from collections import Sequence, Mapping

try:
from salt.utils.files import mkstemp
except ImportError:
Expand Down Expand Up @@ -588,10 +592,10 @@ def validate_policies(policies):
"""
ret = {}
policy_helper = PolicyHelper()
if not isinstance(policies, collections.Sequence):
if not isinstance(policies, Sequence):
policies = [policies]
for policy in policies:
if not isinstance(policy, collections.Mapping):
if not isinstance(policy, Mapping):
return False, 'Policy is not a dictionary object', policy
policy_type = policy.get('policy_type', '').lower()
try:
Expand Down

0 comments on commit 78b933b

Please sign in to comment.