File tree Expand file tree Collapse file tree 2 files changed +5
-16
lines changed Expand file tree Collapse file tree 2 files changed +5
-16
lines changed Original file line number Diff line number Diff line change 1- #!/usr/bin/env python2.7
1+ #!/usr/bin/env python3
22import gyb
33gyb .main ()
Original file line number Diff line number Diff line change 1- #!/usr/bin/env python
1+ #!/usr/bin/env python3
22# GYB: Generate Your Boilerplate (improved names welcome; at least
33# this one's short). See -h output for instructions
44
1111import textwrap
1212import tokenize
1313from bisect import bisect
14-
15-
16- try :
17- from StringIO import StringIO
18- except ImportError :
19- from io import StringIO
20-
21-
22- try :
23- basestring
24- except NameError :
25- basestring = str
14+ from io import StringIO
2615
2716
2817def get_line_starts (s ):
@@ -732,15 +721,15 @@ def execute(self, context):
732721 # If we got a result, the code was an expression, so append
733722 # its value
734723 if result is not None \
735- or (isinstance (result , basestring ) and result != '' ):
724+ or (isinstance (result , str ) and result != '' ):
736725 from numbers import Number , Integral
737726 result_string = None
738727 if isinstance (result , Number ) and not isinstance (result , Integral ):
739728 result_string = repr (result )
740729 elif isinstance (result , Integral ) or isinstance (result , list ):
741730 result_string = str (result )
742731 else :
743- result_string = StringIO ( result ). read ()
732+ result_string = result
744733 context .append_text (
745734 result_string , self .filename , self .start_line_number )
746735
You can’t perform that action at this time.
0 commit comments