Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
9cdf9f3c
Commit
9cdf9f3c
authored
Jan 28, 2014
by
Jason Swails
Browse files
Also catch ValueError in _is_string. Fix indentation to be consistent (5 spaces
to 4 -- this would be a SyntaxError in Python3).
parent
b661807c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
wrappers/python/src/swig_doxygen/swig_lib/python/pythoncode.i
...pers/python/src/swig_doxygen/swig_lib/python/pythoncode.i
+15
-13
No files found.
wrappers/python/src/swig_doxygen/swig_lib/python/pythoncode.i
View file @
9cdf9f3c
...
...
@@ -219,19 +219,21 @@ class State(_object):
#
Strings
can
cause
trouble
#
as
can
any
container
that
has
infinite
levels
of
containment
def
_is_string
(
x
)
:
#
step
1
)
String
is
always
a
container
#
and
its
contents
are
themselves
containers
.
try
:
first_item
=
iter
(
x
)
.
next
()
inner_item
=
iter
(
first_item
)
.
next
()
if
first_item
==
inner_item
:
return
True
else
:
return
False
except
TypeError
:
return
False
except
StopIteration
:
return
False
#
step
1
)
String
is
always
a
container
#
and
its
contents
are
themselves
containers
.
try
:
first_item
=
iter
(
x
)
.
next
()
inner_item
=
iter
(
first_item
)
.
next
()
if
first_item
==
inner_item
:
return
True
else
:
return
False
except
TypeError
:
return
False
except
StopIteration
:
return
False
except
ValueError
:
return
False
def
stripUnits
(
args
)
:
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment