# HG changeset patch # User wycc # Date 1294387125 -28800 # Node ID 983442b2698c2703261609030e638d4765ee10e6 # Parent bdc2ed94ea37babb6f7a713b1da457eb820a19a8 Fix the exception for object without opacity. diff -r bdc2ed94ea37 -r 983442b2698c pyink/tween.py --- a/pyink/tween.py Thu Jan 06 22:06:42 2011 +0800 +++ b/pyink/tween.py Fri Jan 07 15:58:45 2011 +0800 @@ -12,8 +12,12 @@ return float(f[1]) return 1 -def change_opacity(obj,opacity): - style = obj.getAttribute("style") +def change_opacity(obj, opacity): + try: + style = obj.getAttribute("style") + except: + obj.setAttribute("style","opacity:%g" % opacity) + return arr = style.split(';') s='' for a in arr: