Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
56f2a25b
Commit
56f2a25b
authored
Sep 24, 2015
by
Marius Gedminas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Python 3: there's no 'unicode'
parent
6d4618f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
lib/ansible/template/__init__.py
+5
-5
No files found.
lib/ansible/template/__init__.py
View file @
56f2a25b
...
@@ -22,7 +22,7 @@ __metaclass__ = type
...
@@ -22,7 +22,7 @@ __metaclass__ = type
import
ast
import
ast
import
re
import
re
from
six
import
string_types
from
six
import
string_types
,
text_type
,
binary_type
from
jinja2
import
Environment
from
jinja2
import
Environment
from
jinja2.loaders
import
FileSystemLoader
from
jinja2.loaders
import
FileSystemLoader
from
jinja2.exceptions
import
TemplateSyntaxError
,
UndefinedError
from
jinja2.exceptions
import
TemplateSyntaxError
,
UndefinedError
...
@@ -217,10 +217,10 @@ class Templar:
...
@@ -217,10 +217,10 @@ class Templar:
# Don't template unsafe variables, instead drop them back down to
# Don't template unsafe variables, instead drop them back down to
# their constituent type.
# their constituent type.
if
hasattr
(
variable
,
'__UNSAFE__'
):
if
hasattr
(
variable
,
'__UNSAFE__'
):
if
isinstance
(
variable
,
unicod
e
):
if
isinstance
(
variable
,
text_typ
e
):
return
unicod
e
(
variable
)
return
text_typ
e
(
variable
)
elif
isinstance
(
variable
,
str
):
elif
isinstance
(
variable
,
binary_type
):
return
str
(
variable
)
return
bytes
(
variable
)
else
:
else
:
return
variable
return
variable
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment