Skip to content

Commit 97e5ddf

Browse files
committed
bug: move import findargspec out of Permission __init__ method
We have a few places where imports are done inside a method/function. For methods that are called once it's not an issue but the Permissions __init__ method is called often and accounts for > 10% of the time in the __init__ function when looking at wsgi-lineprof output. So move it to the module level.
1 parent 79f56e6 commit 97e5ddf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

roundup/security.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import weakref
77

88
from roundup import hyperdb, support
9+
from roundup.anypy import findargspec
910

1011
logger = logging.getLogger('roundup.security')
1112

@@ -74,7 +75,6 @@ class Permission:
7475

7576
def __init__(self, name='', description='', klass=None,
7677
properties=None, check=None, props_only=None, filter=None):
77-
from roundup.anypy import findargspec
7878
self.name = name
7979
self.description = description
8080
self.klass = klass

0 commit comments

Comments
 (0)