Skip to content

Commit

Permalink
Fix site-packages for Pythonista >= v3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed May 4, 2023
1 parent 1c5c46a commit e417089
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-code-and-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
python -m pip install --upgrade "pip<32.0" wheel setuptools
pip install ".[testing]"
- name: Analysing the code with flake8
run: |
Expand Down
2 changes: 1 addition & 1 deletion bin/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def main(args):
ap = argparse.ArgumentParser()
ap.parse_args(args)

current_worker = threading.currentThread()
current_worker = threading.current_thread()

_stash = globals()['_stash']
""":type : StaSh"""
Expand Down
2 changes: 1 addition & 1 deletion lib/libdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import six


IN_PYTHONISTA = sys.executable.find('Pythonista') >= 0
IN_PYTHONISTA = "Pythonista" in sys.executable
ON_CI = "CI" in os.environ


Expand Down
6 changes: 3 additions & 3 deletions system/shiowrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class ShStdinWrapper(object):
def __getattribute__(self, item):
thread = threading.currentThread()
thread = threading.current_thread()

if isinstance(thread, ShBaseThread):
return getattr(thread.state.sys_stdin, item)
Expand All @@ -24,7 +24,7 @@ def __getattribute__(self, item):

class ShStdoutWrapper(object):
def __getattribute__(self, item):
thread = threading.currentThread()
thread = threading.current_thread()

if isinstance(thread, ShBaseThread):
return getattr(thread.state.sys_stdout, item)
Expand All @@ -34,7 +34,7 @@ def __getattribute__(self, item):

class ShStderrWrapper(object):
def __getattribute__(self, item):
thread = threading.currentThread()
thread = threading.current_thread()

if isinstance(thread, ShBaseThread):
return getattr(thread.state.sys_stderr, item)
Expand Down
2 changes: 1 addition & 1 deletion system/shparsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ def expandvars(self, s):
es += str(os.environ.get(nextchar, ''))
state = 'a'
elif nextchar == '$':
es += str(threading.currentThread()._Thread__ident)
es += str(threading.current_thread()._Thread__ident)
state = 'a'
elif nextchar in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz':
varname += nextchar
Expand Down
4 changes: 2 additions & 2 deletions system/shruntime.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def fn():
current_worker.parent.state.persist_child(current_worker.state, persistent_level=persistent_level)

# Get the parent thread
parent_thread = threading.currentThread()
parent_thread = threading.current_thread()

# UI thread is substituted by runtime
if not isinstance(parent_thread, ShBaseThread):
Expand Down Expand Up @@ -679,7 +679,7 @@ def get_current_worker_and_state(self):
:return:
:rtype: (ShBaseThread, ShState)
"""
current_worker = threading.currentThread()
current_worker = threading.current_thread()
if isinstance(current_worker, ShBaseThread):
return current_worker, current_worker.state
else: # UI thread uses runtime for its state
Expand Down

0 comments on commit e417089

Please sign in to comment.