Commits

Steve Borho committed a7d4a0c

tortoisehg: catch errors on re-unregister

just prevents tracebacks

  • Participants
  • Parent commits 95ec18d

Comments (0)

Files changed (1)

File tortoisehg.py

     key = r"Software\TortoiseHg"
     cat = _winreg.HKEY_LOCAL_MACHINE
     if (unregister):
-        _winreg.DeleteKey(cat, key)
-        print "TortoiseHg unregistered"
+        try:
+            _winreg.DeleteKey(cat, key)
+            print "TortoiseHg unregistered"
+        except WindowsError:
+            print 'TortoiseHg was not registered'
     else:
         _winreg.SetValue(cat, key, _winreg.REG_SZ, bin_path)
         print "TortoiseHg registered"
     else:
         register_tortoise_path()
 
-    
+