From: Felix Domke Date: Sun, 23 Aug 2009 22:35:36 +0000 (+0200) Subject: one less reason for enigma2 to crash on startup when flash is full. X-Git-Tag: 2.6.0~96 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/4248f59b3f494e103114e7291d27542b59cf4ee0?hp=a5ce6afda8ae79133e92403b8d7aaac9a6cd5288 one less reason for enigma2 to crash on startup when flash is full. --- diff --git a/lib/python/Tools/Profile.py b/lib/python/Tools/Profile.py index 5fee5316..4d8dd901 100644 --- a/lib/python/Tools/Profile.py +++ b/lib/python/Tools/Profile.py @@ -9,6 +9,7 @@ profile_start = time.time() profile_data = {} total_time = 1 +profile_file = None try: profile_old = open(resolveFilename(SCOPE_CONFIG, "profile"), "r").readlines() @@ -22,7 +23,10 @@ try: except: print "no profile data available" -profile_file = open(resolveFilename(SCOPE_CONFIG, "profile"), "w") +try: + profile_file = open(resolveFilename(SCOPE_CONFIG, "profile"), "w") +except IOError: + print "WARNING: couldn't open profile file!" def profile(id): now = time.time() - profile_start