Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite old-style-class super calls #320 break my code #547

Closed
Czaki opened this issue Sep 27, 2021 · 1 comment
Closed

Rewrite old-style-class super calls #320 break my code #547

Czaki opened this issue Sep 27, 2021 · 1 comment

Comments

@Czaki
Copy link

Czaki commented Sep 27, 2021

after upgrade from #320 my code is broken with a message:

  >       res = super().asarray(*args, **kwargs)
  E       TypeError: super(type, obj): obj must be an instance or subtype of type

The error may be caused because this part of the code is patching the external library to get progress information.

https://github.com/4DNucleome/PartSeg/blob/5e487764a5a35f4300f43ba81ba72e971565e040/package/PartSegImage/tifffile_fixes.py#L10-L36

is there an option to block this upgrade for this line?

@asottile
Copy link
Owner

yeah if you do terrible things like monkeypatch then all bets are off

I would recommend assigning your wrapped function in the global scope so your code does not break

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants