Skip to content

Commit

Permalink
Python 3: the StringIO module is gone
Browse files Browse the repository at this point in the history
Fixes 17 failing tests on Python 3.4, restoring the 8 failures we had
last Friday.
  • Loading branch information
mgedmin committed Sep 28, 2015
1 parent 4cd810a commit 9b39af8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/ansible/template/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import StringIO
import ast
import contextlib
import os
import re

from six import string_types, text_type, binary_type
from six import string_types, text_type, binary_type, StringIO
from jinja2 import Environment
from jinja2.loaders import FileSystemLoader
from jinja2.exceptions import TemplateSyntaxError, UndefinedError
Expand Down Expand Up @@ -214,7 +213,7 @@ def _clean_data(self, orig_data):
if not isinstance(orig_data, string_types):
return orig_data

with contextlib.closing(StringIO.StringIO(orig_data)) as data:
with contextlib.closing(StringIO(orig_data)) as data:
# these variables keep track of opening block locations, as we only
# want to replace matched pairs of print/block tags
print_openings = []
Expand Down

0 comments on commit 9b39af8

Please sign in to comment.