This website works better with JavaScript.
Home
Explore
Help
Sign In
brettlangdon
/
sysaudit
mirror of
https://github.com/brettlangdon/sysaudit.git
Watch
1
Star
0
Fork
0
Code
Issues
0
Projects
0
Releases
3
Wiki
Activity
Browse Source
use _hooks[:] instead of calling .copy()
pull/3/head
Brett Langdon
5 years ago
parent
2f14c2e8bd
commit
46343c7471
Signed by:
brettlangdon
GPG Key ID:
A70042D88B95AA2B
2 changed files
with
3 additions
and
5 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+1
-2
sysaudit/__init__.py
+2
-3
sysaudit/_csysaudit.pyx
+ 1
- 2
sysaudit/__init__.py
View File
@ -17,8 +17,7 @@ else:
def
audit
(
event
,
*
args
)
:
global
_hooks
# Grab a copy of hooks so we don't need to lock here
hooks
=
_hooks
.
copy
(
)
for
hook
in
hooks
:
for
hook
in
_hooks
[
:
]
:
hook
(
event
,
args
)
def
addaudithook
(
callback
)
:
+ 2
- 3
sysaudit/_csysaudit.pyx
View File
@ -3,9 +3,8 @@ _hooks = list()
def
audit
(
event
,
*
args
)
:
global
_hooks
hooks
=
_hooks
.
copy
(
)
for
hook
in
hooks
:
# Grab a copy of hooks so we don't need to lock here
for
hook
in
_hooks
[
:
]
:
hook
(
event
,
args
)
Write
Preview
Loading…
Cancel
Save