Giter Site home page Giter Site logo

Comments (5)

liorp avatar liorp commented on June 9, 2024

Hi, I couldn't replicate your use case. Can you help me with some more information? The code, perhaps?

from tendo.

liorp avatar liorp commented on June 9, 2024

Hi, in order to understand this issue I'd be happy to receive a code example which fails - I tried running yours but it ran successfully.

Therefore, I suspect it has something to do with your dependencies.

from tendo.

InterStella0 avatar InterStella0 commented on June 9, 2024

Hi, It seems like this only happens with a library I was using which was qasync, it's a PyQt async wrapper.

import sys

import qasync
import tendo
from tendo import singleton

try:
    me = singleton.SingleInstance()
except tendo.singleton.SingleInstanceException:
    sys.exit(0)


def cleanup():
    ...
    sys.exit(0)


async def window():
    cleanup()


qasync.run(window())

Which produces

Exception ignored in: <function SingleInstance.__del__ at 0x0000023F40D696C0>
Traceback (most recent call last):
  File "C:\Users\sarah\PycharmProjects\stella_manager_gui\venv\lib\site-packages\tendo\singleton.py", line 91, in __del__
AttributeError: 'NoneType' object has no attribute 'exit'
Unloggable error: 'NoneType' object has no attribute 'platform'

So technically it's a dependency issue.

from tendo.

liorp avatar liorp commented on June 9, 2024

This occurs because of the way singleton is cleared using del. We should implement something such as context manager with enter and exit, since using del exposes us to bugs like this.

from tendo.

InterStella0 avatar InterStella0 commented on June 9, 2024

Using context manager seems solid, better code flow for edge cases like this.

from tendo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.