Implement PEP 393.
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index cffa5de..6421543 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -103,23 +103,18 @@
         }
     }
     if (n < 0 && result != NULL && PyUnicode_Check(result)) {
-        Py_UNICODE *s = PyUnicode_AS_UNICODE(result);
-        Py_ssize_t len = PyUnicode_GET_SIZE(result);
+        Py_ssize_t len = PyUnicode_GET_LENGTH(result);
         if (len == 0) {
             Py_DECREF(result);
             result = NULL;
             PyErr_SetString(PyExc_EOFError,
                             "EOF when reading a line");
         }
-        else if (s[len-1] == '\n') {
-            if (result->ob_refcnt == 1)
-                PyUnicode_Resize(&result, len-1);
-            else {
-                PyObject *v;
-                v = PyUnicode_FromUnicode(s, len-1);
-                Py_DECREF(result);
-                result = v;
-            }
+        else if (PyUnicode_READ_CHAR(result, len-1) == '\n') {
+            PyObject *v;
+            v = PyUnicode_Substring(result, 0, len-1);
+            Py_DECREF(result);
+            result = v;
         }
     }
     return result;