[Python-3000-checkins] r56554 - python/branches/py3k-struni/Modules/mmapmodule.c

guido.van.rossum python-3000-checkins at python.org
Thu Jul 26 20:28:23 CEST 2007


Author: guido.van.rossum
Date: Thu Jul 26 20:28:23 2007
New Revision: 56554

Modified:
   python/branches/py3k-struni/Modules/mmapmodule.c
Log:
Return bytes, not string from read().  Makes test_mmap.py pass.


Modified: python/branches/py3k-struni/Modules/mmapmodule.c
==============================================================================
--- python/branches/py3k-struni/Modules/mmapmodule.c	(original)
+++ python/branches/py3k-struni/Modules/mmapmodule.c	Thu Jul 26 20:28:23 2007
@@ -226,7 +226,7 @@
 	if ((self->pos + num_bytes) > self->size) {
 		num_bytes -= (self->pos+num_bytes) - self->size;
 	}
-	result = Py_BuildValue("s#", self->data+self->pos, num_bytes);
+	result = PyBytes_FromStringAndSize(self->data+self->pos, num_bytes);
 	self->pos += num_bytes;
 	return result;
 }


More information about the Python-3000-checkins mailing list