1. The Enzo Project
  2. Untitled project
  3. enzo-dev
  4. Pull requests

Pull requests

#174 Merged
Repository
brittonsmith
Branch
week-of-code
Repository
enzo
Branch
week-of-code

Fixing exception handling when hg is not imported.

Author
  1. Britton Smith
Reviewers
Description

Switched to catching the ImportError and RepoError separately so that RepoError does not show up as undefined in the case where mercurial is not installed.

Update 1: reorganized try block for readability.

Comments (1)

  1. Nathan Goldbaum

    What about importing mercurial in a block like this:

    try:
        import mercurial
    except ImportError:
        print "WARNING: could not get version information.  Please install mercurial."
        return ('unknown', 'unknown', None)
    

    Right now this is a little convoluted.