From fc0dcc3947346a567ebf5e5a5932bba298f65910 Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Tue, 22 Sep 2015 08:42:33 +0300 Subject: [PATCH] Python 3: there's no basestring Fixes one failing test. Now technically a filename can be a bytestring, even on Python 3. I hope this is unlikely for Ansible. --- lib/ansible/parsing/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/parsing/__init__.py b/lib/ansible/parsing/__init__.py index 0c8e21fbd21..4efb19f16d3 100644 --- a/lib/ansible/parsing/__init__.py +++ b/lib/ansible/parsing/__init__.py @@ -25,7 +25,7 @@ import os import stat from yaml import load, YAMLError -from six import text_type +from six import text_type, string_types from ansible.errors import AnsibleParserError from ansible.errors.yaml_strings import YAML_SYNTAX_ERROR @@ -154,7 +154,7 @@ class DataLoader(): Reads the file contents from the given file name, and will decrypt them if they are found to be vault-encrypted. ''' - if not file_name or not isinstance(file_name, basestring): + if not file_name or not isinstance(file_name, string_types): raise AnsibleParserError("Invalid filename: '%s'" % str(file_name)) if not self.path_exists(file_name) or not self.is_file(file_name):