From 8a48724b42e80b542b08118729d7cdfa152b5906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20Kr=C3=A1lik?= Date: Wed, 28 Aug 2024 09:59:10 +0200 Subject: [PATCH 1/2] listdir_matches: os.path.isdir is unavailable on barebones micropython; added inline implementation --- rshell/main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rshell/main.py b/rshell/main.py index 40071f5..3cd33ed 100755 --- a/rshell/main.py +++ b/rshell/main.py @@ -850,7 +850,13 @@ def add_suffix_if_dir(filename): # This can happen when a symlink points to a non-existant file. pass return filename - if not os.path.isdir(dirname): + def isdir(path): + try: + mode = os.stat(path)[0] + return mode & 0o040000 + except OSError: + return False + if not isdir(dirname): return [] matches = [add_suffix_if_dir(result_prefix + filename) for filename in os.listdir(dirname) if filename.startswith(match_prefix)] From 72da36ed2a0bf6c034e321609dbdbbfdd3a4be5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20Kr=C3=A1lik?= Date: Wed, 28 Aug 2024 10:00:15 +0200 Subject: [PATCH 2/2] Windows/Python 3.10+ compatibility: replace pyreadline with pyreadline3 --- rshell/version.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rshell/version.py b/rshell/version.py index d9edf17..9ae29b1 100644 --- a/rshell/version.py +++ b/rshell/version.py @@ -1 +1 @@ -__version__ = '0.0.33' +__version__ = '0.0.34' diff --git a/setup.py b/setup.py index 1652e55..be4be84 100644 --- a/setup.py +++ b/setup.py @@ -50,6 +50,6 @@ }, extras_require={ ':sys_platform == "win32"': [ - 'pyreadline'] + 'pyreadline3'] } )