Openmdao 1.7.3 error with unicode variables in python2

30 views Asked by At

In the file openmdao/core/problem.py on lines such as 1619 and 1638, it checks if a variable is a string by using:

isinstance(inp, str)

however, this will return false if inp is unicode in python2, and eventually cause the program to raise an exception. In python2, the correct syntax is:

isinstance(inp, basestring)

I understand that basestring is not available in python 3, but there are several ways to write python 2/3 compatible code. Can this be fixed?

1

There are 1 answers

0
Justin Gray On

feel free to submit a pull request, but please add a test that checks the new functionality