Assertion failure when there are multiple versions of Enthought Canopy

...nopy installed. For example, on my system, I get p2 like this:

['canopy-1.3.0.1715.rh5-x86_64', 'canopy-1.2.0.1610.rh5-x86_64', 'updates']

The for loop on Ln 239 will only remove the 'updates' in p2, which leads to the failure in the assert statement on Ln 242.