Skip to content

Commit

Permalink
If a resource class cannot be found for the resource_type, return a R…
Browse files Browse the repository at this point in the history
…esource object and warns (do not raise)
  • Loading branch information
hgrecco committed Aug 12, 2015
1 parent 786312e commit 987bcf3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyvisa/highlevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1625,7 +1625,8 @@ def open_resource(self, resource_name,
try:
resource_pyclass = self._resource_classes[(info.interface_type, info.resource_class)]
except KeyError:
raise ValueError('There is no class defined for %r' % ((info.interface_type, info.resource_class),))
resource_pyclass = self._resource_classes[(constants.InterfaceType.unknown, '')]
logger.warning('There is no class defined for %r. Using Resource', (info.interface_type, info.resource_class))

res = resource_pyclass(self, resource_name)
for key in kwargs.keys():
Expand Down

0 comments on commit 987bcf3

Please sign in to comment.