Skip to content

Commit

Permalink
Support Python 3 Base WMI (#3036)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmuesch authored Jan 25, 2019
1 parent 9ef9994 commit d92197d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def _get_wmi_sampler(self, instance_key, wmi_class, properties, tag_by="", **kwa
"""
Create and cache a WMISampler for the given (class, properties)
"""
properties = properties + [tag_by] if tag_by else properties
properties = list(properties) + [tag_by] if tag_by else list(properties)

if instance_key not in self.wmi_samplers:
wmi_sampler = WMISampler(self.log, wmi_class, properties, **kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

import pythoncom
import pywintypes
from six import iteritems, string_types
from six import iteritems, string_types, with_metaclass
from six.moves import zip
from win32com.client import Dispatch

Expand Down Expand Up @@ -60,12 +60,10 @@ def __contains__(cls, provider):
return provider in cls._AVAILABLE_PROVIDER_ARCHITECTURES


class ProviderArchitecture(object):
class ProviderArchitecture(with_metaclass(ProviderArchitectureMeta, object)):
"""
Enumerate WMI Provider Architectures.
"""
__metaclass__ = ProviderArchitectureMeta

# Available Provider Architecture(s)
DEFAULT = 0
_32BIT = 32
Expand Down

0 comments on commit d92197d

Please sign in to comment.