Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- compress_lock = threading.Lock()
- @register.tag
- def safe_compress(parser, token):
- # Force single threaded compression
- compress_lock.acquire()
- value = None
- try:
- value = compress(parser, token)
- finally:
- compress_lock.release()
- return value
Advertisement
Add Comment
Please, Sign In to add comment