Skip to content
This repository was archived by the owner on Jun 12, 2021. It is now read-only.

Commit 790e1e7

Browse files
committed
getattr doesn't work on dicts.
1 parent 813c9d4 commit 790e1e7

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/oidcservice/service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ def init_services(service_definitions, service_context, state_db,
516516
"""
517517
Initiates a set of services
518518
519-
:param service_definitions: A dictionary cotaining service definitions
519+
:param service_definitions: A dictionary containing service definitions
520520
:param service_context: A reference to the service context, this is the same
521521
for all service instances.
522522
:param state_db: A reference to the state database. Shared by all the

src/oidcservice/service_context.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ def __init__(self, keyjar=None, config=None, **kwargs):
9292
for attr in ['client_id', 'issuer', 'base_url', 'requests_dir']:
9393
try:
9494
setattr(self, attr, config[attr])
95-
except:
96-
setattr(self, attr, '')
95+
except KeyError:
96+
pass
9797

9898
for attr in RegistrationRequest.c_param.keys():
9999
try:
@@ -105,8 +105,8 @@ def __init__(self, keyjar=None, config=None, **kwargs):
105105
'provider_info']:
106106
try:
107107
setattr(self, attr, config[attr])
108-
except:
109-
setattr(self, attr, {})
108+
except KeyError:
109+
pass
110110

111111
if 'client_secret' in config:
112112
self.set_client_secret(config['client_secret'])

src/oidcservice/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def get_http_body(req, content_type=URL_ENCODED):
6565

6666
def load_yaml_config(filename):
6767
with open(filename, "rt", encoding='utf-8') as file:
68-
config_dict = yaml.load(file)
68+
config_dict = yaml.safe_load(file)
6969
return config_dict
7070

7171

0 commit comments

Comments
 (0)