X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fpython%2FTools%2FProfile.py;h=4d8dd9012841311f2ef3e64a8137e6fcbe69af77;hp=5fee5316faad1dad5174cd6ed82c8565418e242a;hb=ba5fcab217438b995c1f903e0294b71d1411668b;hpb=fcf3e4bc055cd91a47a5aedc91abad9161e180fc diff --git a/lib/python/Tools/Profile.py b/lib/python/Tools/Profile.py index 5fee531..4d8dd90 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