I think BUFFER() should be completely removed; last time I checked it was never used anywhere. Anyway the code was not quite correct because memoryview() was only backported to 2.7, not 2.6.