Skip to content

Commit

Permalink
Updated decorator to use functools.update_wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
sysr-q committed Feb 6, 2013
1 parent 9d9c4ec commit 071b53f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion chrw/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import datetime
import time
import json
import functools

def rate_limited(max_per_second):
""" Sort of based off of an answer about
Expand All @@ -34,7 +35,7 @@ def rate_limited_function(*args, **kwargs):
ret = func(*args, **kwargs)
last_time_called[0] = datetime.datetime.now()
return ret
return rate_limited_function
return functools.update_wrapper(rate_limited_function, func)
return decorate

class wrapper:
Expand Down
2 changes: 1 addition & 1 deletion chrw/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.0.0"
__version__ = "1.0.1"

# Just incase they don't have requests installed yet.
codes = None
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
# The short X.Y version.
version = '1.0'
# The full version, including alpha/beta/rc tags.
release = '1.0.0'
release = '1.0.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down

0 comments on commit 071b53f

Please sign in to comment.