Commits

Jason R. Coombs committed 4335acb

Adding test in setup script to prevent a regression of #55

  • Participants
  • Parent commits b799386

Comments (0)

Files changed (1)

         result = f.read()
     finally:
         f.close()
+    if not encodes_as_ascii(result):
+        # see https://bitbucket.org/kang/python-keyring-lib/issue/55
+        raise ValueError("distutils requires ASCII")
     return result
 
+def encodes_as_ascii(string):
+    try:
+        string.encode('ascii')
+    except UnicodeEncodeError:
+        return False
+    return True
+
 setup_params = dict(
     name = 'keyring',
     version = "0.7.1",