Merge "Splice: Use operator.or_
instead of a lambda-expression"
This commit is contained in:
@@ -18,6 +18,8 @@ Bindings to the `tee` and `splice` system calls
|
|||||||
'''
|
'''
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import operator
|
||||||
|
|
||||||
import ctypes
|
import ctypes
|
||||||
import ctypes.util
|
import ctypes.util
|
||||||
|
|
||||||
@@ -81,7 +83,7 @@ class Tee(object):
|
|||||||
raise EnvironmentError('tee not available')
|
raise EnvironmentError('tee not available')
|
||||||
|
|
||||||
if not isinstance(flags, (int, long)):
|
if not isinstance(flags, (int, long)):
|
||||||
c_flags = reduce(lambda a, b: a | b, flags, 0)
|
c_flags = reduce(operator.or_, flags, 0)
|
||||||
else:
|
else:
|
||||||
c_flags = flags
|
c_flags = flags
|
||||||
|
|
||||||
@@ -172,7 +174,7 @@ class Splice(object):
|
|||||||
raise EnvironmentError('splice not available')
|
raise EnvironmentError('splice not available')
|
||||||
|
|
||||||
if not isinstance(flags, (int, long)):
|
if not isinstance(flags, (int, long)):
|
||||||
c_flags = reduce(lambda a, b: a | b, flags, 0)
|
c_flags = reduce(operator.or_, flags, 0)
|
||||||
else:
|
else:
|
||||||
c_flags = flags
|
c_flags = flags
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user