From 04e5fcbabd2855f8f878cc654fa6494b914372d0 Mon Sep 17 00:00:00 2001 From: Rob Young Date: Wed, 6 Aug 2014 14:15:48 +0100 Subject: [PATCH 1/2] Run tests is travis - Run tests in travis under python2.7 and python3.4 - Add build status badge to README. --- .travis.yml | 8 ++++++++ README.md | 2 ++ 2 files changed, 10 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..5c84ba4 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +language: python +python: + - "2.7" + - "3.4" +install: pip install -r requirements.txt +script: make check +notifications: + email: false diff --git a/README.md b/README.md index 0bd5b50..0808e5a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # backoff +[![Build Status](https://travis-ci.org/litl/backoff.png?branch=master)](https://travis-ci.org/litl/backoff?branch=master) + Function decoration for pluggable backoff and retry This module provides function decorators which can be used to wrap a From 82d5dcd21cb5909003b9e01a3ea44cde4fed5f63 Mon Sep 17 00:00:00 2001 From: Rob Young Date: Wed, 6 Aug 2014 14:38:02 +0100 Subject: [PATCH 2/2] Add support for python 3 The unicode function is not in python 3 as string literals are by default unicode strings. see: http://www.diveintopython3.net/porting-code-to-python-3-with-2to3.html#unicode --- backoff.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backoff.py b/backoff.py index 16bd49b..f8e9881 100644 --- a/backoff.py +++ b/backoff.py @@ -1,4 +1,5 @@ # coding:utf-8 +from __future__ import unicode_literals """ Function decoration for pluggable backoff and retry @@ -154,7 +155,7 @@ def constant(interval): # Formats a function invocation as a unicode string for logging. def _invoc_repr(f, args, kwargs): - args_out = ", ".join(unicode(a) for a in args) + args_out = ", ".join("%s" % a for a in args) if args and kwargs: args_out += ", " if kwargs: