for name, (value, pos) in dictargs.iteritems():
if not name in buffer_options:
raise CompileError(pos, ERR_BUF_OPTION_UNKNOWN % name)
- options[name.encode("ASCII")] = value
-
+ options[name] = value
+
for name, (value, pos) in zip(buffer_options, posargs):
if not name in buffer_options:
raise CompileError(pos, ERR_BUF_OPTION_UNKNOWN % name)
self.keyword_args,
base_type.buffer_defaults)
+ if sys.version_info[0] < 3:
+ # Py 2.x enforces byte strings as keyword arguments ...
+ options = dict([ (name.encode('ASCII'), value)
+ for name, value in options.iteritems() ])
+
self.type = PyrexTypes.BufferType(base_type, **options)
return self.type