@@ -1763,10 +1763,10 @@ def xadd(self, _name, id='*', maxlen=None, approximate=True, **kwargs):
1763
1763
pieces = []
1764
1764
if maxlen is not None :
1765
1765
if not isinstance (maxlen , int ) or maxlen < 1 :
1766
- raise RedisError (" XADD maxlen must be a positive integer" )
1767
- pieces .append (" MAXLEN" )
1766
+ raise RedisError (' XADD maxlen must be a positive integer' )
1767
+ pieces .append (' MAXLEN' )
1768
1768
if approximate :
1769
- pieces .append ("~" )
1769
+ pieces .append ('~' )
1770
1770
pieces .append (str (maxlen ))
1771
1771
pieces .append (id )
1772
1772
for pair in iteritems (kwargs ):
@@ -1788,8 +1788,8 @@ def xrange(self, name, start='-', finish='+', count=None):
1788
1788
pieces = [start , finish ]
1789
1789
if count is not None :
1790
1790
if not isinstance (count , int ) or count < 1 :
1791
- raise RedisError (" XRANGE count must be a positive integer" )
1792
- pieces .append (" COUNT" )
1791
+ raise RedisError (' XRANGE count must be a positive integer' )
1792
+ pieces .append (' COUNT' )
1793
1793
pieces .append (str (count ))
1794
1794
1795
1795
return self .execute_command ('XRANGE' , name , * pieces )
@@ -1808,8 +1808,8 @@ def xrevrange(self, name, start='+', finish='-', count=None):
1808
1808
pieces = [start , finish ]
1809
1809
if count is not None :
1810
1810
if not isinstance (count , int ) or count < 1 :
1811
- raise RedisError (" XREVRANGE count must be a positive integer" )
1812
- pieces .append (" COUNT" )
1811
+ raise RedisError (' XREVRANGE count must be a positive integer' )
1812
+ pieces .append (' COUNT' )
1813
1813
pieces .append (str (count ))
1814
1814
1815
1815
return self .execute_command ('XREVRANGE' , name , * pieces )
@@ -1832,16 +1832,16 @@ def xread(self, count=None, block=None, **streams):
1832
1832
pieces = []
1833
1833
if block is not None :
1834
1834
if not isinstance (block , int ) or block < 0 :
1835
- raise RedisError (" XREAD block must be a non-negative integer" )
1836
- pieces .append (" BLOCK" )
1835
+ raise RedisError (' XREAD block must be a non-negative integer' )
1836
+ pieces .append (' BLOCK' )
1837
1837
pieces .append (str (block ))
1838
1838
if count is not None :
1839
1839
if not isinstance (count , int ) or count < 1 :
1840
- raise RedisError (" XREAD count must be a positive integer" )
1841
- pieces .append (" COUNT" )
1840
+ raise RedisError (' XREAD count must be a positive integer' )
1841
+ pieces .append (' COUNT' )
1842
1842
pieces .append (str (count ))
1843
1843
1844
- pieces .append (" STREAMS" )
1844
+ pieces .append (' STREAMS' )
1845
1845
ids = []
1846
1846
for partial_stream in iteritems (streams ):
1847
1847
pieces .append (partial_stream [0 ])
0 commit comments