diff --git a/examples/hdf5.py b/examples/hdf5.py
index 57b5672f5b2b94ae7de21fdd4be43bd92325fae5..0cbf667f0576c042359c9c6d07e49762366e30f6 100644
--- a/examples/hdf5.py
+++ b/examples/hdf5.py
@@ -25,7 +25,7 @@ if len(sys.argv) > 1:
 else:
     fileName = 'test.hdf5'
     if not os.path.isfile(fileName):
-        print "No suitable HDF5 file found. Use createFile() to generate an example file."
+        print("No suitable HDF5 file found. Use createFile() to generate an example file.")
         os._exit(1)
 
 plt = pg.plot()
diff --git a/setup.py b/setup.py
index 1d3f0b25d491e3a7793ec065977c0c291100da80..826bb57cc9ba4e9237010034068512f5332fa73e 100644
--- a/setup.py
+++ b/setup.py
@@ -46,7 +46,7 @@ try:
         lastTag = gitCommit(lastTagName)
         head = gitCommit('HEAD')
         if head != lastTag:
-            branch = re.search(r'\* (.*)', check_output(['git', 'branch'])).group(1)
+            branch = re.search(r'\* (.*)', check_output(['git', 'branch'], universal_newlines=True)).group(1)
             version = version + "-%s-%s" % (branch, head[:10])
         
         # any uncommitted modifications?