Convert from "print ..." to "print(...)"
[hooke.git] / hooke / util / yaml.py
index e66a68669c3337a25df248f4f90b8d245cffe043..956db4153ffd5c5f0ca36afad8f3e3eba52b8386 100644 (file)
@@ -24,7 +24,7 @@ stored somewhere else or not important.
 
 >>> import yaml
 >>> a = numpy.array([1,2,3])
->>> print yaml.dump(a)
+>>> print(yaml.dump(a))
 null
 ...
 <BLANKLINE>
@@ -33,7 +33,7 @@ The default behavior is to crash.
 
 >>> yaml.Dumper.yaml_representers.pop(numpy.ndarray)  # doctest: +ELLIPSIS
 <function none_representer at 0x...>
->>> print yaml.dump(a)  # doctest: +REPORT_UDIFF
+>>> print(yaml.dump(a))  # doctest: +REPORT_UDIFF
 !!python/object/apply:numpy.core.multiarray._reconstruct
 args:
 - !!python/name:numpy.ndarray ''
@@ -101,7 +101,8 @@ if False: # YAML dump debugging code
     define new types (e.g. numpy.ndarray) which YAML cannot inspect.
     """
     def ignore_aliases(data):
-        print data, repr(data), type(data), repr(type(data))
+        print(' '.join(str(x) for x in [
+                    data, repr(data), type(data), repr(type(data))]))
         sys.stdout.flush()
         if data in [None, ()]:
             return True