summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2018-09-26 11:11:06 +0200
committermakefu <github@syntax-fehler.de>2018-09-26 11:11:06 +0200
commitd7ecf1abdcc52e82af8ea17e4fc8d4be8fc41822 (patch)
treead4da7b3071dd6b2c5990a3de3cd380d5052767d /krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py
parent7a0d3121be1ae433a612ad77e9bb693a66aed41c (diff)
parenta374a452112ba962ab90e45b6b0f27b3a1330e4f (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.py12
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']