summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2020-01-08 01:22:03 -0600
committerMichael Merickel <michael@merickel.org>2020-01-08 01:22:03 -0600
commit2bf834c98a6d125c820996ad86d5bc1ac2dbf7e7 (patch)
tree40c200da03cbf33b14731a870fe73e9221d20436
parent5f114efcc63a9158dff7afb2a3974f56a5d09784 (diff)
downloadpyramid-2bf834c98a6d125c820996ad86d5bc1ac2dbf7e7.tar.gz
pyramid-2bf834c98a6d125c820996ad86d5bc1ac2dbf7e7.tar.bz2
pyramid-2bf834c98a6d125c820996ad86d5bc1ac2dbf7e7.zip
fix lint
-rw-r--r--src/pyramid/request.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pyramid/request.py b/src/pyramid/request.py
index 83134666d..8bb1e2632 100644
--- a/src/pyramid/request.py
+++ b/src/pyramid/request.py
@@ -378,6 +378,7 @@ class RequestLocalCache:
.. versionadded:: 2.0
"""
+
NO_VALUE = Sentinel('NO_VALUE')
def __init__(self):
@@ -393,10 +394,13 @@ class RequestLocalCache:
return decorator(self.inst, self.__wrapped__)(*args, **kwargs)
def __get__(self, instance, owner):
- return decorator(self.inst, self.__wrapped__.__get__(instance, owner))
+ return decorator(
+ self.inst, self.__wrapped__.__get__(instance, owner)
+ )
def adapt(inst, fn):
return FunctionOrMethodAdapter(inst, fn)
+
return adapt
@auto_adapt
@@ -405,6 +409,7 @@ class RequestLocalCache:
Decorate a method or function.
"""
+
@functools.wraps(fn)
def wrapper(request, *args, **kwargs):
result = self.get(request)
@@ -413,6 +418,7 @@ class RequestLocalCache:
self.set(request, result)
request.add_finished_callback(self.clear)
return result
+
return wrapper
del auto_adapt