python3: deprecate file builtin (#32815)
This commit is contained in:
parent
a516e02de0
commit
23145898bd
|
@ -17,7 +17,8 @@ LOCALE_PATHS = ('/var/lib/authentic2/locale',) + LOCALE_PATHS
|
|||
ADMINS = (('root', 'root@localhost'),)
|
||||
|
||||
if os.path.exists('/var/lib/authentic2/secret_key'):
|
||||
SECRET_KEY = file('/var/lib/authentic2/secret_key').read()
|
||||
with open('/var/lib/authentic2/secret_key') as f:
|
||||
SECRET_KEY = f.read()
|
||||
|
||||
LOGGING = {
|
||||
'version': 1,
|
||||
|
|
|
@ -17,7 +17,8 @@ LOCALE_PATHS = ('/var/lib/authentic2/locale',) + LOCALE_PATHS
|
|||
ADMINS = (('root', 'root@localhost'),)
|
||||
|
||||
if os.path.exists('/var/lib/authentic2/secret_key'):
|
||||
SECRET_KEY = file('/var/lib/authentic2/secret_key').read()
|
||||
with open('/var/lib/authentic2/secret_key') as f:
|
||||
SECRET_KEY = f.read()
|
||||
|
||||
LOGGING = {
|
||||
'version': 1,
|
||||
|
|
|
@ -66,7 +66,7 @@ def test_load_ldif(db, monkeypatch, tmpdir):
|
|||
def __init__(self, *args, **kwargs):
|
||||
self.users = []
|
||||
assert len(args) == 1
|
||||
assert isinstance(args[0], file)
|
||||
assert isinstance(args[0], FileType)
|
||||
assert kwargs['options']['extra_attribute'] == {'ldap_attr': 'first_name'}
|
||||
assert kwargs['options']['result'] == 'result'
|
||||
|
||||
|
@ -84,7 +84,7 @@ def test_load_ldif(db, monkeypatch, tmpdir):
|
|||
def __init__(self, *args, **kwargs):
|
||||
self.users = []
|
||||
assert len(args) == 1
|
||||
assert isinstance(args[0], file)
|
||||
assert isinstance(args[0], FileType)
|
||||
assert kwargs['options']['extra_attribute'] == {
|
||||
'ldap_attr': 'first_name'}
|
||||
assert kwargs['options']['result'] == 'result'
|
||||
|
|
Loading…
Reference in New Issue