diff --git a/launch.sh b/launch.sh index 0c73c667c65fd2a049c7412c47479e4d624bcc59..be228d543f1498f267bae367e94fc4e46370a71b 100755 --- a/launch.sh +++ b/launch.sh @@ -1,3 +1,3 @@ #!/bin/sh cd "$(dirname $0)/src" -exec python -OOt gajim.py "$@" +exec python -m cProfile gajim.py "$@" diff --git a/src/common/caps_cache.py b/src/common/caps_cache.py index 6a3b3591a0f1ac7b1e9f2aa1e352dd3d95c7966e..f4bc02fcd2f6959ca4db80e98965b66947a8cfb3 100644 --- a/src/common/caps_cache.py +++ b/src/common/caps_cache.py @@ -245,6 +245,16 @@ class NullClientCaps(AbstractClientCaps): Assumes (almost) everything is supported. """ + _instance = None + def __new__(cls, *args, **kwargs): + """ + Make it a singleton. + """ + if not cls._instance: + cls._instance = super(NullClientCaps, cls).__new__( + cls, *args, **kwargs) + return cls._instance + def __init__(self): AbstractClientCaps.__init__(self, None, None)