Backported support for Enthought Canope from the master branch (b11efc19).