Skip to content

Commit

Permalink
Remove more Python 2 compatibility code
Browse files Browse the repository at this point in the history
  • Loading branch information
knabar committed Feb 7, 2024
1 parent 7db0f55 commit 0c4bc24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 1 addition & 4 deletions omeroweb/webadmin/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@

import logging

try:
from collections import OrderedDict # Python 2.7+ only
except Exception:
pass
from collections import OrderedDict

from django import forms
from django.forms.widgets import Textarea
Expand Down
3 changes: 1 addition & 2 deletions omeroweb/webclient/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5034,8 +5034,7 @@ def run_script(request, conn, sId, inputMap, scriptName="Script"):
request.session.modified = True
except Exception as x:
jobId = str(time()) # E.g. 1312803670.6076391
# handle python 2 or 3 errors
message = x.message if hasattr(x, "message") else (x.args[0] if x.args else "")
message = x.args[0] if x.args else ""
if message and message.startswith("No processor available"):
# omero.ResourceError
logger.info(traceback.format_exc())
Expand Down

0 comments on commit 0c4bc24

Please sign in to comment.