python: Avoid Python3-only form of super().
authorJustus Winter <justus@g10code.com>
Mon, 12 Sep 2016 15:21:34 +0000 (17:21 +0200)
committerJustus Winter <justus@g10code.com>
Mon, 12 Sep 2016 15:24:18 +0000 (17:24 +0200)
* lang/python/pyme/core.py (GpgmeWrapper.__repr__): Use more
compatible form of super.
(GpgmeWrapper.__setattr__): Likewise.
(Context.__init__): Likewise.
(Data.__init__): Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
lang/python/pyme/core.py

index f9df6e8..4bbbc17 100644 (file)
@@ -45,7 +45,8 @@ class GpgmeWrapper(object):
         self.wrapped = wrapped
 
     def __repr__(self):
         self.wrapped = wrapped
 
     def __repr__(self):
-        return '<{}/{!r}>'.format(super().__repr__(), self.wrapped)
+        return '<{}/{!r}>'.format(super(GpgmeWrapper, self).__repr__(),
+                                  self.wrapped)
 
     def __str__(self):
         acc = ['{}.{}'.format(__name__, self.__class__.__name__)]
 
     def __str__(self):
         acc = ['{}.{}'.format(__name__, self.__class__.__name__)]
@@ -153,7 +154,7 @@ class GpgmeWrapper(object):
         if key in self._boolean_properties:
             self.__wrap_boolean_property(key, True, value)
         else:
         if key in self._boolean_properties:
             self.__wrap_boolean_property(key, True, value)
         else:
-            super().__setattr__(key, value)
+            super(GpgmeWrapper, self).__setattr__(key, value)
 
 class Context(GpgmeWrapper):
     """Context for cryptographic operations
 
 class Context(GpgmeWrapper):
     """Context for cryptographic operations
@@ -191,7 +192,7 @@ class Context(GpgmeWrapper):
             wrapped = gpgme.gpgme_ctx_t_p_value(tmp)
             gpgme.delete_gpgme_ctx_t_p(tmp)
             self.own = True
             wrapped = gpgme.gpgme_ctx_t_p_value(tmp)
             gpgme.delete_gpgme_ctx_t_p(tmp)
             self.own = True
-        super().__init__(wrapped)
+        super(Context, self).__init__(wrapped)
         self.armor = armor
         self.textmode = textmode
         self.offline = offline
         self.armor = armor
         self.textmode = textmode
         self.offline = offline
@@ -873,7 +874,7 @@ class Data(GpgmeWrapper):
         that file.
 
         """
         that file.
 
         """
-        super().__init__(None)
+        super(Data, self).__init__(None)
         self.data_cbs = None
 
         if cbs != None:
         self.data_cbs = None
 
         if cbs != None: