summaryrefslogtreecommitdiff
path: root/pyvisa/attributes.py
diff options
context:
space:
mode:
authorRuben Undheim <ruben.undheim@gmail.com>2018-08-19 22:12:30 +0200
committerRuben Undheim <ruben.undheim@gmail.com>2018-08-19 22:12:30 +0200
commit9c5924b696b7c9fa626464a294c5c235ed166bf8 (patch)
treed84d390f71a9ebacf7e300838c535bcfb26e9ecc /pyvisa/attributes.py
parent482f79d72e2e19442e33bc9db5b7b8b10661381e (diff)
New upstream version 1.9.1
Diffstat (limited to 'pyvisa/attributes.py')
-rw-r--r--pyvisa/attributes.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/pyvisa/attributes.py b/pyvisa/attributes.py
index 80f8b9b..95e429d 100644
--- a/pyvisa/attributes.py
+++ b/pyvisa/attributes.py
@@ -41,7 +41,10 @@ class AttributeType(type):
if not name.startswith('AttrVI_'):
return
cls.attribute_id = getattr(constants, cls.visa_name)
- cls.redoc()
+ # Check that the docstring are populated before extending them
+ # Cover the case of running with Python with -OO option
+ if cls.__doc__ is not None:
+ cls.redoc()
if cls.resources is AllSessionTypes:
AttributesPerResource[AllSessionTypes].add(cls)
else:
@@ -181,7 +184,7 @@ class RangeAttribute(IntAttribute):
if not self.values:
raise ValueError('%r is an invalid value for attribute %s, '
'should be between %r and %r' % (
- value,
+ value,
self.visa_name,
self.min_value,
self.max_value))
@@ -190,7 +193,7 @@ class RangeAttribute(IntAttribute):
'should be between %r and %r or %r' % (
value,
self.visa_name,
- self.min_value,
+ self.min_value,
self.max_value,
self.values))
return value