Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Commit

Permalink
Fix 'DevFailed' object does not support indexing when creating a devi…
Browse files Browse the repository at this point in the history
…ce (PR #220)

It's a python3-only bug.
  • Loading branch information
vxgmichel authored Sep 27, 2018
2 parents 28f67c0 + 196e02d commit 4b429e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tango/pyutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __Util__create_device(self, klass_name, device_name, alias=None, cb=None):
try:
db.import_device(device_name)
except DevFailed as df:
device_exists = not df[0].reason == "DB_DeviceNotDefined"
device_exists = not df.args[0].reason == "DB_DeviceNotDefined"

# 1 - Make sure device name doesn't exist already in the database
if device_exists:
Expand Down Expand Up @@ -169,7 +169,7 @@ def __Util__delete_device(self, klass_name, device_name):
try:
db.import_device(device_name)
except DevFailed as df:
device_exists = not df[0].reason == "DB_DeviceNotDefined"
device_exists = not df.args[0].reason == "DB_DeviceNotDefined"

# 1 - Make sure device name exists in the database
if not device_exists:
Expand Down

0 comments on commit 4b429e7

Please sign in to comment.