how about if

hasattr(fig, 'show')

?

would that work?