You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

19 line
501 B

  1. # -*- coding: utf-8 -*-
  2. from __future__ import (absolute_import, division, print_function,
  3. unicode_literals)
  4. from functools import partial
  5. from redis import Redis
  6. def fix_return_type(func):
  7. # deliberately no functools.wraps() call here, since the function being
  8. # wrapped is a partial, which has no module
  9. def _inner(*args, **kwargs):
  10. value = func(*args, **kwargs)
  11. if value is None:
  12. value = -1
  13. return value
  14. return _inner