From 4e80b669a3088cfef098d2bee765dbeaaa740430 Mon Sep 17 00:00:00 2001 From: Richard Neumann Date: Thu, 10 Feb 2022 11:05:55 +0100 Subject: [PATCH] Make readline depend on module presence --- rcon/readline.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rcon/readline.py b/rcon/readline.py index 40467fb..04654fc 100644 --- a/rcon/readline.py +++ b/rcon/readline.py @@ -1,12 +1,11 @@ """Wrapper for readline support.""" from logging import Logger -from os import name from pathlib import Path -if name == 'posix': +try: from readline import read_history_file, write_history_file -else: +except ModuleNotFoundError: read_history_file = write_history_file = lambda _: None