diff options
author | makefu <github@syntax-fehler.de> | 2018-09-26 11:11:06 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2018-09-26 11:11:06 +0200 |
commit | d7ecf1abdcc52e82af8ea17e4fc8d4be8fc41822 (patch) | |
tree | ad4da7b3071dd6b2c5990a3de3cd380d5052767d /krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py | |
parent | 7a0d3121be1ae433a612ad77e9bb693a66aed41c (diff) | |
parent | a374a452112ba962ab90e45b6b0f27b3a1330e4f (diff) |
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py')
-rw-r--r-- | krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py b/krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py index 51ac7a071..ecb03917b 100644 --- a/krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py +++ b/krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py @@ -8,9 +8,19 @@ import shelve from os import environ from os.path import join from sys import argv +from time import sleep import re -d = shelve.open(join(environ['state_dir'], 'sed-plugin.shelve'), writeback=True) +# try to open the shelve file until it succeeds +while True: + try: + d = shelve.open( + join(environ['state_dir'], 'sed-plugin.shelve'), + writeback=True + ) + break + except: # noqa: E722 + sleep(0.2) usr = environ['_from'] |