Skip to content

Commit

Permalink
Merge pull request redis#588 from paulkeene/master
Browse files Browse the repository at this point in the history
Fix pep8 errors
  • Loading branch information
andymccurdy committed Feb 10, 2015
2 parents 767e260 + 92e3618 commit bc61eb9
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 18 deletions.
49 changes: 32 additions & 17 deletions redis/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,23 @@ def safe_unicode(obj, *args):
ascii_text = str(obj).encode('string_escape')
return unicode(ascii_text)

iteritems = lambda x: x.iteritems()
iterkeys = lambda x: x.iterkeys()
itervalues = lambda x: x.itervalues()
nativestr = lambda x: \
x if isinstance(x, str) else x.encode('utf-8', 'replace')
u = lambda x: x.decode()
b = lambda x: x
next = lambda x: x.next()
byte_to_chr = lambda x: x
def iteritems(x): return x.iteritems()

def iterkeys(x): return x.iterkeys()

def itervalues(x): return x.itervalues()

def nativestr(x):
return x if isinstance(x, str) else x.encode('utf-8', 'replace')

def u(x): return x.decode()

def b(x): return x

def next(x): return x.next()

def byte_to_chr(x): return x

unichr = unichr
xrange = xrange
basestring = basestring
Expand All @@ -44,14 +52,21 @@ def safe_unicode(obj, *args):
from string import ascii_letters
from queue import Queue

iteritems = lambda x: iter(x.items())
iterkeys = lambda x: iter(x.keys())
itervalues = lambda x: iter(x.values())
byte_to_chr = lambda x: chr(x)
nativestr = lambda x: \
x if isinstance(x, str) else x.decode('utf-8', 'replace')
u = lambda x: x
b = lambda x: x.encode('latin-1') if not isinstance(x, bytes) else x
def iteritems(x): return iter(x.items())

def iterkeys(x): return iter(x.keys())

def itervalues(x): return iter(x.values())

def byte_to_chr(x): return chr(x)

def nativestr(x):
return x if isinstance(x, str) else x.decode('utf-8', 'replace')

def u(x): return x

def b(x): return x.encode('latin-1') if not isinstance(x, bytes) else x

next = next
unichr = chr
imap = map
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def run_tests(self):
except ImportError:

from distutils.core import setup
PyTest = lambda x: x

def PyTest(x): x

f = open(os.path.join(os.path.dirname(__file__), 'README.rst'))
long_description = f.read()
Expand Down

0 comments on commit bc61eb9

Please sign in to comment.