From a58f4cc5d2c4f2293d9c82394511389883d83502 2012-08-27 06:06:45
From: Jörgen Stenarson <jorgen.stenarson@kroywen.se>
Date: 2012-08-27 06:06:45
Subject: [PATCH] check for bytes instead of str for python3 compatibility

---

diff --git a/IPython/utils/openpy.py b/IPython/utils/openpy.py
index 38fb150..5074e8e 100644
--- a/IPython/utils/openpy.py
+++ b/IPython/utils/openpy.py
@@ -130,7 +130,7 @@ def source_to_unicode(txt, errors='replace', skip_encoding_cookie=True):
     """
     if isinstance(txt, unicode):
         return txt
-    if isinstance(txt, str):
+    if isinstance(txt, bytes):
         buffer = BytesIO(txt)
     else:
         buffer = txt