|
23 | 23 | SCHEMA_CLASS_MAPPING[o.schema_attribute] = o
|
24 | 24 | SCHEMA_ATTR_MAPPING[o] = o.schema_attribute
|
25 | 25 |
|
26 |
| -SCHEMA_ATTRS = SCHEMA_CLASS_MAPPING.keys() |
| 26 | +SCHEMA_ATTRS = list(SCHEMA_CLASS_MAPPING) |
27 | 27 |
|
28 | 28 |
|
29 | 29 | class SubschemaError(ValueError):
|
@@ -122,15 +122,15 @@ def __init__(self,sub_schema_sub_entry,check_uniqueness=1):
|
122 | 122 | self.sed[se_class][se_id] = se_instance
|
123 | 123 |
|
124 | 124 | if hasattr(se_instance,'names'):
|
125 |
| - for name in ldap.cidict.cidict({}.fromkeys(se_instance.names)).keys(): |
| 125 | + for name in ldap.cidict.cidict({}.fromkeys(se_instance.names)): |
126 | 126 | if check_uniqueness and name in self.name2oid[se_class]:
|
127 | 127 | self.non_unique_names[se_class][se_id] = None
|
128 | 128 | raise NameNotUnique(attr_value)
|
129 | 129 | else:
|
130 | 130 | self.name2oid[se_class][name] = se_id
|
131 | 131 |
|
132 | 132 | # Turn dict into list maybe more handy for applications
|
133 |
| - self.non_unique_oids = self.non_unique_oids.keys() |
| 133 | + self.non_unique_oids = list(self.non_unique_oids) |
134 | 134 |
|
135 | 135 | return # subSchema.__init__()
|
136 | 136 |
|
@@ -168,7 +168,7 @@ def listall(self,schema_element_class,schema_element_filters=None):
|
168 | 168 | except AttributeError:
|
169 | 169 | pass
|
170 | 170 | else:
|
171 |
| - result = avail_se.keys() |
| 171 | + result = list(avail_se) |
172 | 172 | return result
|
173 | 173 |
|
174 | 174 |
|
@@ -422,14 +422,14 @@ def attribute_types(
|
422 | 422 |
|
423 | 423 | # Remove all mandantory attribute types from
|
424 | 424 | # optional attribute type list
|
425 |
| - for a in list(r_may.keys()): |
| 425 | + for a in list(r_may): |
426 | 426 | if a in r_must:
|
427 | 427 | del r_may[a]
|
428 | 428 |
|
429 | 429 | # Apply attr_type_filter to results
|
430 | 430 | if attr_type_filter:
|
431 | 431 | for l in [r_must,r_may]:
|
432 |
| - for a in list(l.keys()): |
| 432 | + for a in list(l): |
433 | 433 | for afk,afv in attr_type_filter:
|
434 | 434 | try:
|
435 | 435 | schema_attr_type = self.sed[AttributeType][a]
|
|
0 commit comments