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

Fix 'DevFailed' object does not support indexing #220

Merged
merged 1 commit into from
Sep 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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