StringTypes has gone
[plcapi.git] / PLC / GPG.py
index 270bc45..4a99884 100644 (file)
@@ -11,7 +11,6 @@
 import os
 import xmlrpc.client
 import shutil
-from types import StringTypes
 from io import StringIO
 from subprocess import Popen, PIPE, call
 from tempfile import NamedTemporaryFile, mkdtemp
@@ -29,7 +28,7 @@ def canonicalize(args, methodname = None, methodresponse = False):
     xml = xmlrpc.client.dumps(args, methodname, methodresponse, encoding = 'utf-8', allow_none = 1)
     dom = etree.fromstring(xml)
     canonical=etree.tostring(dom)
-    # pre-f20 version was using Canonicalize from PyXML 
+    # pre-f20 version was using Canonicalize from PyXML
     # from xml.dom.ext import Canonicalize
     # Canonicalize(), though it claims to, does not encode unicode
     # nodes to UTF-8 properly and throws an exception unless you write
@@ -76,7 +75,7 @@ def gpg_sign(args, secret_keyring, keyring, methodname = None, methodresponse =
     """
 
     # Accept either an opaque string blob or a Python tuple
-    if isinstance(args, StringTypes):
+    if isinstance(args, str):
         message = args
     elif isinstance(args, tuple):
         message = canonicalize(args, methodname, methodresponse)
@@ -123,7 +122,7 @@ def gpg_verify(args, key, signature = None, methodname = None, methodresponse =
     """
 
     # Accept either an opaque string blob or a Python tuple
-    if isinstance(args, StringTypes):
+    if isinstance(args, str):
         message = args
     else:
         message = canonicalize(args, methodname, methodresponse)