diff --git a/polyfile/repl.py b/polyfile/repl.py index 9c0b170c..882409bf 100644 --- a/polyfile/repl.py +++ b/polyfile/repl.py @@ -3,12 +3,17 @@ from enum import Enum from functools import partial, wraps from io import StringIO +import os from pathlib import Path -import readline import sys import traceback from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Set, Tuple, Type, TypeVar, Union +if os.name == "posix": + import readline +else: + import pyreadline3 as readline + from .logger import getStatusLogger log = getStatusLogger("polyfile") diff --git a/setup.py b/setup.py index 49a4a6fd..e43dd15d 100644 --- a/setup.py +++ b/setup.py @@ -121,16 +121,17 @@ def update(self, n: int): packages=find_packages(exclude=("tests",)), python_requires='>=3.7', install_requires=[ - 'cint', - 'graphviz', - 'intervaltree', - 'jinja2', - 'kaitaistruct>=0.7', - 'networkx', - 'pdfminer.six', # currently just for ascii85decode - 'Pillow>=5.0.0', - 'pyyaml>=3.13', - 'setuptools' + "cint", + "graphviz", + "intervaltree", + "jinja2", + "kaitaistruct>=0.7", + "networkx", + "pdfminer.six", + "Pillow>=5.0.0", + "pyreadline3;platform_system=='Windows'", + "pyyaml>=3.13", + "setuptools" ], extras_require={ 'demangle': ['cxxfilt'],