File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 11import json
2+ import pkgutil
23from random import Random
34
4- from pkg_resources import resource_filename
55from .sampling_rule import SamplingRule
66from ...exceptions .exceptions import InvalidSamplingManifestError
77
8-
9- with open (resource_filename (__name__ , 'sampling_rule.json' )) as f :
10- local_sampling_rule = json .load (f )
8+ local_sampling_rule = json .loads (pkgutil .get_data (__name__ , 'sampling_rule.json' ))
119
1210SUPPORTED_RULE_VERSION = (1 , 2 )
1311
Original file line number Diff line number Diff line change 11from __future__ import absolute_import
22# Need absolute import as botocore is also in the current folder for py27
33import json
4+ import pkgutil
45
5- from pkg_resources import resource_filename
66from botocore .exceptions import ClientError
77
88from aws_xray_sdk .core import xray_recorder
1212from aws_xray_sdk .ext .util import inject_trace_header , to_snake_case
1313
1414
15- with open (resource_filename (__name__ , 'resources/aws_para_whitelist.json' ), 'r' ) as data_file :
16- whitelist = json .load (data_file )
15+ whitelist = json .loads (pkgutil .get_data (__name__ , 'resources/aws_para_whitelist.json' ))
1716
1817
1918def inject_header (wrapped , instance , args , kwargs ):
You can’t perform that action at this time.
0 commit comments