File tree 1 file changed +13
-4
lines changed
1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 1
1
2
+ import imp
3
+ import os .path
4
+
2
5
from amazonproduct import HOSTS
3
6
4
- import os .path
5
7
_here = os .path .abspath (os .path .dirname (__file__ ))
6
8
9
+
10
+ try :
11
+ fp , path , desc = imp .find_module ('config' , [_here ])
12
+ _config = imp .load_module ('config' , fp , _here , desc )
13
+ except ImportError :
14
+ _config = None
15
+
7
16
#: Directory containing XML responses for API versions (one directory for each
8
17
#: API version)
9
18
XML_TEST_DIR = _here
@@ -23,11 +32,11 @@ def get_config_value(key, default=None):
23
32
(in that order).
24
33
"""
25
34
try :
26
- config = __import__ ('config' )
27
- return getattr (config , key )
28
- except (ImportError , AttributeError ):
35
+ return getattr (_config , key )
36
+ except AttributeError :
29
37
return os .environ .get (key , default )
30
38
31
39
AWS_KEY = get_config_value ('AWS_KEY' , '' )
32
40
SECRET_KEY = get_config_value ('SECRET_KEY' , '' )
33
41
OVERWRITE_TESTS = get_config_value ('OVERWRITE_TESTS' , '' )
42
+
You can’t perform that action at this time.
0 commit comments