Ver código fonte

[fix]#485 AttributeError: 'module' object has no attribute 'old_where'

misnyo 9 anos atrás
pai
commit
f86e212dba
1 arquivos alterados com 2 adições e 1 exclusões
  1. 2
    1
      searx/__init__.py

+ 2
- 1
searx/__init__.py Ver arquivo

@@ -52,7 +52,8 @@ logger = logging.getLogger('searx')
52 52
 # Workaround for openssl versions <1.0.2
53 53
 # https://github.com/certifi/python-certifi/issues/26
54 54
 if OPENSSL_VERSION_INFO[0:3] < (1, 0, 2):
55
-    environ['REQUESTS_CA_BUNDLE'] = certifi.old_where()
55
+    if hasattr(certifi, 'old_where'):
56
+        environ['REQUESTS_CA_BUNDLE'] = certifi.old_where()
56 57
     logger.warning('You are using an old openssl version({0}), please upgrade above 1.0.2!'.format(OPENSSL_VERSION))
57 58
 
58 59
 logger.info('Initialisation done')