Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enforce on static methods #55

Open
bannsec opened this issue Sep 4, 2017 · 1 comment
Open

enforce on static methods #55

bannsec opened this issue Sep 4, 2017 · 1 comment

Comments

@bannsec
Copy link

bannsec commented Sep 4, 2017

I'm attempting to use enforce over a class. However, one of the methods in this class is static, and marked so by:

@staticmethod

When attempting to run, i get the following:

In [7]: Keyboard._parse_modifier(2)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-7-2977a0e8d3a6> in <module>()
----> 1 Keyboard._parse_modifier(2)

~/.virtualenvs/usb_pcap/lib/python3.5/site-packages/enforce/decorators.py in universal(wrapped, instance, args, kwargs)
     83         """
     84         with RunLock:
---> 85             enforcer = wrapped.__enforcer__
     86             skip = False
     87

AttributeError: 'functools.partial' object has no attribute '__enforcer__'

Same error occurs if i remove my type hints.

TheDataLeek pushed a commit to TheDataLeek/enforce that referenced this issue Sep 5, 2017
TheDataLeek pushed a commit to TheDataLeek/enforce that referenced this issue Sep 5, 2017
RussBaz added a commit that referenced this issue Oct 18, 2017
@danie1k
Copy link

danie1k commented Nov 14, 2017

@RussBaz, please publish new version on pypi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants