[pypy-commit] pypy space-newtext: tweaks
arigo
pypy.commits at gmail.com
Tue Feb 14 06:36:38 EST 2017
Author: Armin Rigo <arigo at tunes.org>
Branch: space-newtext
Changeset: r90108:a4d3c68d1442
Date: 2017-02-14 12:09 +0100
http://bitbucket.org/pypy/pypy/changeset/a4d3c68d1442/
Log: tweaks
diff --git a/pypy/interpreter/pyparser/error.py b/pypy/interpreter/pyparser/error.py
--- a/pypy/interpreter/pyparser/error.py
+++ b/pypy/interpreter/pyparser/error.py
@@ -12,14 +12,8 @@
self.lastlineno = lastlineno
def wrap_info(self, space):
- if self.filename is None:
- w_filename = space.w_None
- else:
- w_filename = space.newtext_or_none(self.filename)
- if self.text is None:
- w_text = space.w_None
- else:
- w_text = space.newtext(self.text)
+ w_filename = space.newtext_or_none(self.filename)
+ w_text = space.newtext_or_none(self.text)
return space.newtuple([space.newtext(self.msg),
space.newtuple([w_filename,
space.newint(self.lineno),
diff --git a/pypy/module/gc/referents.py b/pypy/module/gc/referents.py
--- a/pypy/module/gc/referents.py
+++ b/pypy/module/gc/referents.py
@@ -202,7 +202,7 @@
def get_typeids_z(space):
a = rgc.get_typeids_z()
s = ''.join([a[i] for i in range(len(a))])
- return space.newtext(s)
+ return space.newbytes(s)
def get_typeids_list(space):
l = rgc.get_typeids_list()
More information about the pypy-commit
mailing list