mirror of
https://github.com/cool-RR/PySnooper.git
synced 2026-01-23 10:15:11 +00:00
Remove more calls to decode using u prefix
This commit is contained in:
parent
aedaa7ee56
commit
93edf6fced
2 changed files with 2 additions and 6 deletions
|
|
@ -139,9 +139,7 @@ class Tracer:
|
|||
if self.overwrite and not self._did_overwrite:
|
||||
self.truncate()
|
||||
self._did_overwrite = True
|
||||
s = '{self.prefix}{s}\n'.format(**locals())
|
||||
if isinstance(s, bytes): # Python 2 compatibility
|
||||
s = s.decode()
|
||||
s = u'{self.prefix}{s}\n'.format(**locals())
|
||||
self._write(s)
|
||||
|
||||
def __enter__(self):
|
||||
|
|
|
|||
|
|
@ -275,13 +275,11 @@ def test_unavailable_source():
|
|||
sys_tools.TempSysPathAdder(str(folder)):
|
||||
module_name = 'iaerojajsijf'
|
||||
python_file_path = folder / ('%s.py' % (module_name,))
|
||||
content = ('import pysnooper\n'
|
||||
content = (u'import pysnooper\n'
|
||||
'\n'
|
||||
'@pysnooper.snoop()\n'
|
||||
'def f(x):\n'
|
||||
' return x\n')
|
||||
if six.PY2:
|
||||
content = content.decode()
|
||||
with python_file_path.open('w') as python_file:
|
||||
python_file.write(content)
|
||||
module = __import__(module_name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue