Fixed array.fromfile(); removed references to PyFileObject in array.tofile().
Fixed test_array by removing tests that these two functions don't work
with cStringIO objects (which makes no sense).
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index 07a796f..2eb64f3 100755
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -6,7 +6,7 @@
import unittest
from test import test_support
from weakref import proxy
-import array, cStringIO, math
+import array, io, math
from pickle import loads, dumps
class ArraySubclass(array.array):
@@ -162,7 +162,6 @@
def test_tofromfile(self):
a = array.array(self.typecode, 2*self.example)
self.assertRaises(TypeError, a.tofile)
- ##self.assertRaises(TypeError, a.tofile, cStringIO.StringIO())
f = open(test_support.TESTFN, 'wb')
try:
a.tofile(f)
@@ -170,11 +169,6 @@
b = array.array(self.typecode)
f = open(test_support.TESTFN, 'rb')
self.assertRaises(TypeError, b.fromfile)
- self.assertRaises(
- TypeError,
- b.fromfile,
- cStringIO.StringIO(), len(self.example)
- )
b.fromfile(f, len(self.example))
self.assertEqual(b, array.array(self.typecode, self.example))
self.assertNotEqual(a, b)