File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -642,26 +642,26 @@ def splitgophertype(selector):
642642def unquote (s ):
643643 i = 0
644644 n = len (s )
645- res = ''
645+ res = []
646646 while 0 <= i < n :
647647 j = _quoteprog .search (s , i )
648648 if j < 0 :
649- res = res + s [i :]
649+ res . append ( s [i :])
650650 break
651- res = res + (s [i :j ] + chr (string .atoi (s [j + 1 :j + 3 ], 16 )))
651+ res . append (s [i :j ] + chr (string .atoi (s [j + 1 :j + 3 ], 16 )))
652652 i = j + 3
653- return res
653+ return string . joinfields ( res , '' )
654654
655655always_safe = string .letters + string .digits + '_,.-'
656656def quote (s , safe = '/' ):
657657 safe = always_safe + safe
658- res = ''
658+ res = []
659659 for c in s :
660660 if c in safe :
661- res = res + c
661+ res . append ( c )
662662 else :
663- res = res + '%%%02x' % ord (c )
664- return res
663+ res . append ( '%%%02x' % ord (c ) )
664+ return string . joinfields ( res , '' )
665665
666666
667667# Proxy handling
You can’t perform that action at this time.
0 commit comments