Skip to content

Commit aedf844

Browse files
authored
Merge pull request #7324 from toffaletti/master
2 parents 58f81f4 + b9118b0 commit aedf844

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

utils/gyb.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515

1616
from bisect import bisect
1717

18+
try:
19+
basestring
20+
except NameError:
21+
basestring = str
22+
1823

1924
def get_line_starts(s):
2025
"""Return a list containing the start index of each line in s.
@@ -716,7 +721,8 @@ def execute(self, context):
716721

717722
# If we got a result, the code was an expression, so append
718723
# its value
719-
if result is not None and result != '':
724+
if result is not None \
725+
or (isinstance(result, basestring) and result != ''):
720726
from numbers import Number, Integral
721727
result_string = None
722728
if isinstance(result, Number) and not isinstance(result, Integral):

0 commit comments

Comments
 (0)