From 10f367224d5f30c3398169ffe3087f225f3343fc Mon Sep 17 00:00:00 2001 From: janonymous Date: Fri, 3 Jul 2015 00:05:36 +0530 Subject: [PATCH] Fix Python 3 issues * Replace long with six.integer_type six.integer_type :In Python 2, this is long and int, and in Python 3, just int. 'long' is an undefined variable in py3. Change-Id: Ibe4c5d0d81fe883f4fe33be93a68d814a228ad28 --- swift/common/splice.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/swift/common/splice.py b/swift/common/splice.py index f27ba6cd55..7bc279c5dc 100644 --- a/swift/common/splice.py +++ b/swift/common/splice.py @@ -19,7 +19,7 @@ Bindings to the `tee` and `splice` system calls import os import operator - +import six import ctypes import ctypes.util @@ -85,7 +85,7 @@ class Tee(object): if not self.available: raise EnvironmentError('tee not available') - if not isinstance(flags, (int, long)): + if not isinstance(flags, six.integer_types): c_flags = reduce(operator.or_, flags, 0) else: c_flags = flags @@ -176,7 +176,7 @@ class Splice(object): if not self.available: raise EnvironmentError('splice not available') - if not isinstance(flags, (int, long)): + if not isinstance(flags, six.integer_types): c_flags = reduce(operator.or_, flags, 0) else: c_flags = flags