Checking wx or qt is running in gui __init__.py

In the gui init file, please can someone explain how

if wx.GetApp() is None:

is checking if wx is NOT running?

Surely if wx was not running then there would be an error, and if it is running then wx.GetApp() would indeed return None?

slight update to my question…

If I run:

import wx
print wx.GetApp() is None

in cmd I get True, but in PsychoPy shell I get False? Tried looking up wx literature but still don’t understand.