Mercurial > p > roundup > code
comparison scripts/copy-user.py @ 8528:fed0f839c260
fix: replace except: with except Exception: (by haosenwang1018@github)
Remove bare 'except:' statements replace with 'except Exception'.
In roundup_xmlrpc_server.py I changed Exception to BaseException so
the database gets closed on signals as well. The rest of the changes
do not look like they affect data integrity and are commited as
supplied.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Thu, 26 Feb 2026 09:46:02 -0500 |
| parents | 2a6c3eb4e059 |
| children | 9c3ec0a5c7fc |
comparison
equal
deleted
inserted
replaced
| 8527:d4a43d9da8ef | 8528:fed0f839c260 |
|---|---|
| 29 'organisation', 'alternate_addresses', 'roles', 'timezone'] | 29 'organisation', 'alternate_addresses', 'roles', 'timezone'] |
| 30 | 30 |
| 31 try: | 31 try: |
| 32 instance1 = roundup.instance.open(home1) | 32 instance1 = roundup.instance.open(home1) |
| 33 print("Opened source instance: %s" % home1) | 33 print("Opened source instance: %s" % home1) |
| 34 except: | 34 except Exception: |
| 35 print("Can't open source instance: %s" % home1) | 35 print("Can't open source instance: %s" % home1) |
| 36 sys.exit(1) | 36 sys.exit(1) |
| 37 | 37 |
| 38 try: | 38 try: |
| 39 instance2 = roundup.instance.open(home2) | 39 instance2 = roundup.instance.open(home2) |
| 40 print("Opened target instance: %s" % home2) | 40 print("Opened target instance: %s" % home2) |
| 41 except: | 41 except Exception: |
| 42 print("Can't open target instance: %s" % home2) | 42 print("Can't open target instance: %s" % home2) |
| 43 sys.exit(1) | 43 sys.exit(1) |
| 44 | 44 |
| 45 db1 = instance1.open('admin') | 45 db1 = instance1.open('admin') |
| 46 db2 = instance2.open('admin') | 46 db2 = instance2.open('admin') |
