Splice: Use operator.or_ instead of a lambda-expression

Suggested by Samuel Merritt in https://review.openstack.org/#/c/135319/

Change-Id: I5b86f25b42ffa6d4f9626dc6eb207ae0425933a8
This commit is contained in:
Nicolas Trangez
2014-11-26 10:02:30 +01:00
parent 2a0a8ae00f
commit b0f9575be3

View File

@@ -18,6 +18,8 @@ Bindings to the `tee` and `splice` system calls
'''
import os
import operator
import ctypes
import ctypes.util
@@ -81,7 +83,7 @@ class Tee(object):
raise EnvironmentError('tee not available')
if not isinstance(flags, (int, long)):
c_flags = reduce(lambda a, b: a | b, flags, 0)
c_flags = reduce(operator.or_, flags, 0)
else:
c_flags = flags
@@ -172,7 +174,7 @@ class Splice(object):
raise EnvironmentError('splice not available')
if not isinstance(flags, (int, long)):
c_flags = reduce(lambda a, b: a | b, flags, 0)
c_flags = reduce(operator.or_, flags, 0)
else:
c_flags = flags