prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  AttributeError: 'module' object has no attribute 'old_where'
  I updated my searx instance today, and got the following error:
  
  ```
  Traceback (most recent call last):
    File "/usr/local/searx/searx/__init__.py", line 55, in <module>
      environ['REQUESTS_CA_BUNDLE'] = certifi.old_where()
  AttributeError: 'module' object has no attribute 'old_where'
  ```
  
  I updated the dependencies with `pip install --upgrade -r requirements.txt` before running searx.
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `searx/__init__.py`
  Content:
  ```
  1 '''
  2 searx is free software: you can redistribute it and/or modify
  3 it under the terms of the GNU Affero General Public License as published by
  4 the Free Software Foundation, either version 3 of the License, or
  5 (at your option) any later version.
  6 
  7 searx is distributed in the hope that it will be useful,
  8 but WITHOUT ANY WARRANTY; without even the implied warranty of
  9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  10 GNU Affero General Public License for more details.
  11 
  12 You should have received a copy of the GNU Affero General Public License
  13 along with searx. If not, see < http://www.gnu.org/licenses/ >.
  14 
  15 (C) 2013- by Adam Tauber, <asciimoo@gmail.com>
  16 '''
  17 
  18 import certifi
  19 import logging
  20 from os import environ
  21 from os.path import realpath, dirname, join, abspath
  22 from ssl import OPENSSL_VERSION_INFO, OPENSSL_VERSION
  23 try:
  24     from yaml import load
  25 except:
  26     from sys import exit, stderr
  27     stderr.write('[E] install pyyaml\n')
  28     exit(2)
  29 
  30 searx_dir = abspath(dirname(__file__))
  31 engine_dir = dirname(realpath(__file__))
  32 
  33 # if possible set path to settings using the
  34 # enviroment variable SEARX_SETTINGS_PATH
  35 if 'SEARX_SETTINGS_PATH' in environ:
  36     settings_path = environ['SEARX_SETTINGS_PATH']
  37 # otherwise using default path
  38 else:
  39     settings_path = join(searx_dir, 'settings.yml')
  40 
  41 # load settings
  42 with open(settings_path) as settings_yaml:
  43     settings = load(settings_yaml)
  44 
  45 if settings.get('general', {}).get('debug'):
  46     logging.basicConfig(level=logging.DEBUG)
  47 else:
  48     logging.basicConfig(level=logging.WARNING)
  49 
  50 logger = logging.getLogger('searx')
  51 
  52 # Workaround for openssl versions <1.0.2
  53 # https://github.com/certifi/python-certifi/issues/26
  54 if OPENSSL_VERSION_INFO[0:3] < (1, 0, 2):
  55     environ['REQUESTS_CA_BUNDLE'] = certifi.old_where()
  56     logger.warning('You are using an old openssl version({0}), please upgrade above 1.0.2!'.format(OPENSSL_VERSION))
  57 
  58 logger.info('Initialisation done')
  59
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/searx/__init__.py b/searx/__init__.py
  --- a/searx/__init__.py
  +++ b/searx/__init__.py
  @@ -52,7 +52,8 @@
   # Workaround for openssl versions <1.0.2
   # https://github.com/certifi/python-certifi/issues/26
   if OPENSSL_VERSION_INFO[0:3] < (1, 0, 2):
  -    environ['REQUESTS_CA_BUNDLE'] = certifi.old_where()
  +    if hasattr(certifi, 'old_where'):
  +        environ['REQUESTS_CA_BUNDLE'] = certifi.old_where()
       logger.warning('You are using an old openssl version({0}), please upgrade above 1.0.2!'.format(OPENSSL_VERSION))
   
   logger.info('Initialisation done')
  
verification_info: {"golden_diff": "diff --git a/searx/__init__.py b/searx/__init__.py\n--- a/searx/__init__.py\n+++ b/searx/__init__.py\n@@ -52,7 +52,8 @@\n # Workaround for openssl versions <1.0.2\n # https://github.com/certifi/python-certifi/issues/26\n if OPENSSL_VERSION_INFO[0:3] < (1, 0, 2):\n-    environ['REQUESTS_CA_BUNDLE'] = certifi.old_where()\n+    if hasattr(certifi, 'old_where'):\n+        environ['REQUESTS_CA_BUNDLE'] = certifi.old_where()\n     logger.warning('You are using an old openssl version({0}), please upgrade above 1.0.2!'.format(OPENSSL_VERSION))\n \n logger.info('Initialisation done')\n", "issue": "AttributeError: 'module' object has no attribute 'old_where'\nI updated my searx instance today, and got the following error:\n\n```\nTraceback (most recent call last):\n  File \"/usr/local/searx/searx/__init__.py\", line 55, in <module>\n    environ['REQUESTS_CA_BUNDLE'] = certifi.old_where()\nAttributeError: 'module' object has no attribute 'old_where'\n```\n\nI updated the dependencies with `pip install --upgrade -r requirements.txt` before running searx.\n\n", "before_files": [{"content": "'''\nsearx is free software: you can redistribute it and/or modify\nit under the terms of the GNU Affero General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nsearx is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License\nalong with searx. If not, see < http://www.gnu.org/licenses/ >.\n\n(C) 2013- by Adam Tauber, <asciimoo@gmail.com>\n'''\n\nimport certifi\nimport logging\nfrom os import environ\nfrom os.path import realpath, dirname, join, abspath\nfrom ssl import OPENSSL_VERSION_INFO, OPENSSL_VERSION\ntry:\n    from yaml import load\nexcept:\n    from sys import exit, stderr\n    stderr.write('[E] install pyyaml\\n')\n    exit(2)\n\nsearx_dir = abspath(dirname(__file__))\nengine_dir = dirname(realpath(__file__))\n\n# if possible set path to settings using the\n# enviroment variable SEARX_SETTINGS_PATH\nif 'SEARX_SETTINGS_PATH' in environ:\n    settings_path = environ['SEARX_SETTINGS_PATH']\n# otherwise using default path\nelse:\n    settings_path = join(searx_dir, 'settings.yml')\n\n# load settings\nwith open(settings_path) as settings_yaml:\n    settings = load(settings_yaml)\n\nif settings.get('general', {}).get('debug'):\n    logging.basicConfig(level=logging.DEBUG)\nelse:\n    logging.basicConfig(level=logging.WARNING)\n\nlogger = logging.getLogger('searx')\n\n# Workaround for openssl versions <1.0.2\n# https://github.com/certifi/python-certifi/issues/26\nif OPENSSL_VERSION_INFO[0:3] < (1, 0, 2):\n    environ['REQUESTS_CA_BUNDLE'] = certifi.old_where()\n    logger.warning('You are using an old openssl version({0}), please upgrade above 1.0.2!'.format(OPENSSL_VERSION))\n\nlogger.info('Initialisation done')\n", "path": "searx/__init__.py"}], "after_files": [{"content": "'''\nsearx is free software: you can redistribute it and/or modify\nit under the terms of the GNU Affero General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nsearx is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License\nalong with searx. If not, see < http://www.gnu.org/licenses/ >.\n\n(C) 2013- by Adam Tauber, <asciimoo@gmail.com>\n'''\n\nimport certifi\nimport logging\nfrom os import environ\nfrom os.path import realpath, dirname, join, abspath\nfrom ssl import OPENSSL_VERSION_INFO, OPENSSL_VERSION\ntry:\n    from yaml import load\nexcept:\n    from sys import exit, stderr\n    stderr.write('[E] install pyyaml\\n')\n    exit(2)\n\nsearx_dir = abspath(dirname(__file__))\nengine_dir = dirname(realpath(__file__))\n\n# if possible set path to settings using the\n# enviroment variable SEARX_SETTINGS_PATH\nif 'SEARX_SETTINGS_PATH' in environ:\n    settings_path = environ['SEARX_SETTINGS_PATH']\n# otherwise using default path\nelse:\n    settings_path = join(searx_dir, 'settings.yml')\n\n# load settings\nwith open(settings_path) as settings_yaml:\n    settings = load(settings_yaml)\n\nif settings.get('general', {}).get('debug'):\n    logging.basicConfig(level=logging.DEBUG)\nelse:\n    logging.basicConfig(level=logging.WARNING)\n\nlogger = logging.getLogger('searx')\n\n# Workaround for openssl versions <1.0.2\n# https://github.com/certifi/python-certifi/issues/26\nif OPENSSL_VERSION_INFO[0:3] < (1, 0, 2):\n    if hasattr(certifi, 'old_where'):\n        environ['REQUESTS_CA_BUNDLE'] = certifi.old_where()\n    logger.warning('You are using an old openssl version({0}), please upgrade above 1.0.2!'.format(OPENSSL_VERSION))\n\nlogger.info('Initialisation done')\n", "path": "searx/__init__.py"}]}