From cf82af897894e9c5e9c36bb11e57aca2e89896d7 Mon Sep 17 00:00:00 2001 From: nvbn Date: Mon, 27 Jul 2015 17:39:41 +0300 Subject: [PATCH] #313 Remove `types.Script`, use `Command` with `None` as `stdout` and `stderr` --- thefuck/main.py | 4 ++-- thefuck/rules/dirty_unzip.py | 1 - thefuck/types.py | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/thefuck/main.py b/thefuck/main.py index 37c06e5c..8ea1f82b 100644 --- a/thefuck/main.py +++ b/thefuck/main.py @@ -97,12 +97,12 @@ def get_command(settings, args): return types.Command(script, stdout, stderr) else: logs.debug(u'Execution timed out!', settings) - return types.Script(script) + return types.Command(script, None, None) def get_matched_rule(command, rules, settings): """Returns first matched rule for command.""" - script_only = isinstance(command, types.Script) + script_only = command.stdout is None and command.stderr is None for rule in rules: if script_only and rule.requires_output: diff --git a/thefuck/rules/dirty_unzip.py b/thefuck/rules/dirty_unzip.py index 503b2bcf..4f6e6bcc 100644 --- a/thefuck/rules/dirty_unzip.py +++ b/thefuck/rules/dirty_unzip.py @@ -1,6 +1,5 @@ import os import zipfile -from thefuck import logs def _is_bad_zip(file): diff --git a/thefuck/types.py b/thefuck/types.py index 8ee392d8..71828edb 100644 --- a/thefuck/types.py +++ b/thefuck/types.py @@ -2,7 +2,6 @@ from collections import namedtuple Command = namedtuple('Command', ('script', 'stdout', 'stderr')) -Script = namedtuple('Script', ('script')) Rule = namedtuple('Rule', ('name', 'match', 'get_new_command', 'enabled_by_default', 'side_effect',