Fix X509Name getattro and update tests to expect bytes back from get_components
diff --git a/OpenSSL/crypto/x509name.c b/OpenSSL/crypto/x509name.c
index 1c69be1..e10c5a5 100644
--- a/OpenSSL/crypto/x509name.c
+++ b/OpenSSL/crypto/x509name.c
@@ -154,9 +154,10 @@
char *utf8string;
char *name;
#ifdef PY3
- nameobj = PyUnicode_AsASCIIString(nameobj);
-#endif
+ name = PyBytes_AsString(PyUnicode_AsASCIIString(nameobj));
+#else
name = PyBytes_AsString(nameobj);
+#endif
if ((nid = OBJ_txt2nid(name)) == NID_undef) {
/*