Skip to content

Python 3.2.3 and other stuff #3

@rchateauneu

Description

@rchateauneu

Hi,

I have to use pywbem with Python 3.2.3 which is OK if SSL is not required. However, I found (and probably fixed) a couple of issues when calling EnumerateClasses. Here are the diffs, nothing really complicated:

--- /drives/c/Python/3.2.3-0.3/Lib/pywbem/cim_obj.py
+++ /drives/d/Projects/Divers/PythonInstalls/python3-pywbem/python3_pywbem/cim_obj.py
@@ -834,15 +834,9 @@
             if value is None:
                 # Try to infer from embedded_object, reference_class, and type
                 if embedded_object == 'instance':
-                    #Restore original behaviour.
-                                   #raise ValueError('Limitation: Simple property %r that ' \
-                    #        'is Null cannot have embedded instances '\
-                    #        '(class cannot be specified)' % name)
-                    msg = 'Property %r contains embedded instance' % name
-                    _type = _intended_value('string',
-                            None, _type, 'type', msg)
-                    reference_class = _intended_value(None,
-                            None, reference_class, 'reference_class', msg)
+                    raise ValueError('Limitation: Simple property %r that ' \
+                            'is Null cannot have embedded instances '\
+                            '(class cannot be specified)' % name)
                 elif embedded_object == 'object':
                     msg = 'Property %r contains embedded object' % name
                     _type = _intended_value('string',
@@ -1884,8 +1878,7 @@
         # Don't let anyone set integer or float values.  You must use
         # a subclass from the cim_type module.

-        # if isinstance(value, six.integer_types + (float,)):
-        if type(value) in ( six.integer_types + (float,)):
+        if isinstance(value, six.integer_types + (float,)):
             raise TypeError('Must use a CIM type for numeric qualifiers.')

         self.value = value
--- /drives/c/Python/3.2.3-0.3/Lib/pywbem/tupleparse.py
+++ /drives/d/Projects/Divers/PythonInstalls/python3-pywbem/python3_pywbem/tupleparse.py
@@ -837,7 +837,7 @@

     a = attrs(tt)

-    q = CIMQualifier(a['NAME'], unpack_value(tt), _type=a['TYPE'])
+    q = CIMQualifier(a['NAME'], unpack_value(tt), type=a['TYPE'])

     ## TODO: Lift this out?
     for i in ['OVERRIDABLE', 'TOSUBCLASS', 'TOINSTANCE',

Hope it helps.

Remi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions