summaryrefslogtreecommitdiffstats
path: root/docs/docsite/rst/dev_guide/testing/sanity/no-main-display.rst
blob: 271f88f1889524b5e8f90c57b7ccf1c839a181a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
no-main-display
===============

As of Ansible 2.8, ``Display`` should no longer be imported from ``__main__``.

``Display`` is now a singleton and should be utilized like the following:

.. code-block:: python

   from ansible.utils.display import Display
   display = Display()

There is no longer a need to attempt ``from __main__ import display`` inside
a ``try/except`` block.