File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 7373 # In python 3, unicode -> str, and str -> bytes
7474 unicode = str
7575
76+ PY32 = (sys .version_info >= (3 , 2 ))
77+
7678
7779def is_bool_true (value ):
7880 """Check to see if a string is true, yes, on, or 1
@@ -456,15 +458,23 @@ def aws_credential_file(self):
456458 config_string = fp .read ()
457459 try :
458460 try :
459- config .read_file (io .StringIO (config_string ))
461+ buf = io .StringIO (config_string )
462+ if PY32 :
463+ config .read_file (buf )
464+ else :
465+ config .readfp (buf )
460466 except MissingSectionHeaderError :
461467 # if header is missing, this could be deprecated
462468 # credentials file format as described here:
463469 # https://blog.csanchez.org/2011/05/
464470 # then do the hacky-hack and add default header
465471 # to be able to read the file with PyConfigParser()
466472 config_string = u'[default]\n ' + config_string
467- config .read_file (io .StringIO (config_string ))
473+ buf = io .StringIO (config_string )
474+ if PY32 :
475+ config .read_file (buf )
476+ else :
477+ config .readfp (buf )
468478 except ParsingError as exc :
469479 raise ValueError (
470480 "Error reading aws_credential_file "
You can’t perform that action at this time.
0 commit comments