Fix mypy error

This commit is contained in:
Philipp Hörist 2019-04-14 10:44:08 +02:00
parent d8beb0183c
commit ecdf1526fb
1 changed files with 6 additions and 2 deletions

View File

@ -25,6 +25,9 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Gajim. If not, see <http://www.gnu.org/licenses/>. # along with Gajim. If not, see <http://www.gnu.org/licenses/>.
from typing import Any # pylint: disable=unused-import
from typing import Dict # pylint: disable=unused-import
import sys import sys
import re import re
import os import os
@ -1523,8 +1526,9 @@ def save_roster_position(window):
class Singleton(type): class Singleton(type):
_instances = {} _instances = {} # type: Dict[Any, Any]
def __call__(cls, *args, **kwargs): def __call__(cls, *args, **kwargs):
if cls not in cls._instances: if cls not in cls._instances:
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) cls._instances[cls] = super(Singleton, cls).__call__(
*args, **kwargs)
return cls._instances[cls] return cls._instances[cls]