fix error with hg versions <4.3 (regression from commit:4dddc56)
    
        | author | Sascha Nemecek <nemecek@wienfluss.net> | 
    
        | date | Tue, 19 Dec 2017 14:53:00 +0100 | 
    
    
        | parents | 4dddc56c4c4b | 
    
        | children | 0850e9a3c68b | 
    
        | branches/tags | (none) | 
    
        | files | prompt.py | 
Changes
    
--- a/prompt.py	Fri Oct 20 10:51:53 2017 -0500
+++ b/prompt.py	Tue Dec 19 14:53:00 2017 +0100
@@ -20,12 +20,12 @@
 from mercurial.i18n import _
 from mercurial.node import hex, short
 
-# command registration moved into `registrar` module in v3.7.
+# command registration moved into `registrar` module in v4.3.
 cmdtable = {}
 try:
     from mercurial import registrar
     command = registrar.command(cmdtable)
-except ImportError:
+except (ImportError, AttributeError) as e:
     command = cmdutil.command(cmdtable)
 
 # `revrange' has been moved into module `scmutil' since v1.9.