array.array.__init__(self, typecode)
tests = [] # list to accumulate all tests
-typecodes = "cubBhHiIlLfd"
+typecodes = "cbBhHiIlLfd"
+if test_support.have_unicode:
+ typecodes += "u"
class BadConstructorTest(unittest.TestCase):
self.assertEqual(s.color, "red")
self.assertEqual(s.__dict__.keys(), ["color"])
+ @test_support.requires_unicode
def test_nounicode(self):
a = array.array(self.typecode, self.example)
self.assertRaises(ValueError, a.fromunicode, unicode(''))
if (PyString_Check(typecode) && PyString_GET_SIZE(typecode) == 1)
c = (unsigned char)*PyString_AS_STRING(typecode);
+#ifdef Py_USING_UNICODE
else if (PyUnicode_Check(typecode) && PyUnicode_GET_SIZE(typecode) == 1)
c = *PyUnicode_AS_UNICODE(typecode);
+#endif
else {
PyErr_Format(PyExc_TypeError,
"array() argument 1 or typecode must be char (string or "