summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichele Simionato <michele.simionato@gmail.com>2018-01-14 07:54:50 +0100
committerGitHub <noreply@github.com>2018-01-14 07:54:50 +0100
commit3886353eb19cf81dec4f99098febb8e28640ad51 (patch)
treed0234453ec0a5b282434df74b3fe751cc721f0e2 /src
parent9e0b29c86d233fcc2f212bfb11bcac48d4891bbc (diff)
parent124fb117987a4361dd1536cbcf1ec2cd41b037d4 (diff)
downloadpython-decorator-git-3886353eb19cf81dec4f99098febb8e28640ad51.tar.gz
Merge pull request #46 from ddaanet/master
Enable pylint to support decorator.contextmanager
Diffstat (limited to 'src')
-rw-r--r--src/decorator.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/decorator.py b/src/decorator.py
index 788f4bb..e213bc3 100644
--- a/src/decorator.py
+++ b/src/decorator.py
@@ -298,7 +298,12 @@ elif n_args == 4: # (self, gen, args, kwds) Python 3.5
return _GeneratorContextManager.__init__(self, g, a, k)
ContextManager.__init__ = __init__
-contextmanager = decorator(ContextManager)
+_contextmanager = decorator(ContextManager)
+
+
+def contextmanager(func):
+ # Enable Pylint config: contextmanager-decorators=decorator.contextmanager
+ return _contextmanager(func)
# ############################ dispatch_on ############################ #