enforce icon indicating copy to clipboard operation
enforce copied to clipboard

enforce on static methods

Open bannsec opened this issue 8 years ago • 1 comments

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.

bannsec avatar Sep 04 '17 20:09 bannsec

@RussBaz, please publish new version on pypi.

danie1k avatar Nov 14 '17 10:11 danie1k