diff --git a/pyVmomi/Iso8601.py b/pyVmomi/Iso8601.py index c66ef7d5e..19a66d430 100644 --- a/pyVmomi/Iso8601.py +++ b/pyVmomi/Iso8601.py @@ -14,7 +14,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - +from __future__ import print_function +# TODO (hartsocks): Introduce logging to remove the need for print function. """ This module is for ISO 8601 parsing """ @@ -253,7 +254,7 @@ def ISO8601Format(dt): ]: dt = ParseISO8601(testStr) if dt == None: - print 'Failed to parse (%s)' % testStr + print('Failed to parse ({0})'.format(testStr)) assert(False) # Make sure we can translate back @@ -262,16 +263,16 @@ def ISO8601Format(dt): if dt.tzinfo is None: dt = dt.replace(tzinfo=dt1.tzinfo) if dt1 != dt: - print 'ParseISO8601 -> ISO8601Format -> ParseISO8601 failed (%s)' % testStr + print('ParseISO8601 -> ISO8601Format -> ParseISO8601 failed ({0})'.format(testStr)) assert(False) # Make sure we can parse python isoformat() dt2 = ParseISO8601(dt.isoformat()) if dt2 == None: - print 'ParseISO8601("%s".isoformat()) failed' % testStr + print('ParseISO8601("{0}".isoformat()) failed'.format(testStr)) assert(False) - print testStr, '->', dt, isoformat + print(testStr, '->', dt, isoformat) # Basic form for testStr in [ @@ -293,7 +294,7 @@ def ISO8601Format(dt): # Reject for now dt = ParseISO8601(testStr) if dt != None: - print 'ParseISO8601 (%s) should fail, but it did not' % testStr + print('ParseISO8601 ({0}) should fail, but it did not'.format(testStr)) assert(False) #print testStr, '->', dt #assert(dt != None) @@ -352,5 +353,5 @@ def ISO8601Format(dt): ]: dt = ParseISO8601(testStr) if dt != None: - print 'ParseISO8601 (%s) should fail, but it did not' % testStr + print('ParseISO8601 ({0}) should fail, but it did not'.format(testStr)) assert(False)