Skip to content

Commit

Permalink
Remove py3compat import
Browse files Browse the repository at this point in the history
  • Loading branch information
dalthviz committed Jan 30, 2023
1 parent ee5399f commit f058ba2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions spyder_line_profiler/spyder/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
import hashlib
import inspect
import linecache
import re
import os
import os.path as osp
import pickle
import re
import time
from datetime import datetime

Expand All @@ -35,7 +36,6 @@
from spyder.utils import programs
from spyder.utils.misc import getcwd_or_home
from spyder.plugins.run.widgets import get_run_configuration
from spyder.py3compat import to_text_string, pickle

# Local imports
from spyder_line_profiler.spyder.config import CONF_SECTION
Expand Down Expand Up @@ -315,7 +315,7 @@ def analyze(self, filename=None, wdir=None, args=None, pythonpath=None,
self.kill_if_running()
#index, _data = self.get_data(filename) # FIXME: storing data is not implemented yet
if filename is not None:
filename = osp.abspath(to_text_string(filename))
filename = osp.abspath(str(filename))
index = self.filecombo.findText(filename)
if index == -1:
self.filecombo.addItem(filename)
Expand All @@ -325,7 +325,7 @@ def analyze(self, filename=None, wdir=None, args=None, pythonpath=None,
self.filecombo.selected()

if self.filecombo.is_valid():
filename = to_text_string(self.filecombo.currentText())
filename = str(self.filecombo.currentText())
runconf = get_run_configuration(filename)
if runconf is not None:
if wdir is None:
Expand Down Expand Up @@ -384,7 +384,7 @@ def update_timer(self):
self.datelabel.setText(_(f'Profiling, please wait... elapsed: {elapsed}'))

def start(self, wdir=None, args=None, pythonpath=None):
filename = to_text_string(self.filecombo.currentText())
filename = str(self.filecombo.currentText())

if wdir in [None, False]:
wdir = self._last_wdir
Expand Down Expand Up @@ -414,7 +414,7 @@ def start(self, wdir=None, args=None, pythonpath=None):
self.process.finished.connect(self.finished)

if pythonpath is not None:
env = [to_text_string(_pth)
env = [str(_pth)
for _pth in self.process.systemEnvironment()]
env.append(f'PYTHONPATH={pythonpath}')
processEnvironment = QProcessEnvironment()
Expand Down Expand Up @@ -470,7 +470,7 @@ def read_output(self, error=False):
qba += self.process.readAllStandardError()
else:
qba += self.process.readAllStandardOutput()
text = to_text_string(locale_codec.toUnicode(qba.data()))
text = str(locale_codec.toUnicode(qba.data()))
if error:
self.error_output += text
else:
Expand Down Expand Up @@ -511,7 +511,7 @@ def show_data(self, justanalyzed=False):
self.save_action.setEnabled(output_exists)

self.kill_if_running()
filename = to_text_string(self.filecombo.currentText())
filename = str(self.filecombo.currentText())
if not filename:
return

Expand Down

0 comments on commit f058ba2

Please sign in to comment.