mirror of
https://github.com/samba-team/samba.git
synced 2025-12-24 04:23:53 +03:00
gp: Use read_file() instead of readfp()
readfp() is deprecated and could be removed in a future version of Python. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
committed by
Andrew Bartlett
parent
34042677b7
commit
2b566979ac
@@ -362,9 +362,9 @@ class gp_inf_ext(gp_ext):
|
||||
inf_conf = ConfigParser(interpolation=None)
|
||||
inf_conf.optionxform = str
|
||||
try:
|
||||
inf_conf.readfp(StringIO(policy.decode()))
|
||||
inf_conf.read_file(StringIO(policy.decode()))
|
||||
except UnicodeDecodeError:
|
||||
inf_conf.readfp(StringIO(policy.decode('utf-16')))
|
||||
inf_conf.read_file(StringIO(policy.decode('utf-16')))
|
||||
return inf_conf
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user