Skip to content

Commit

Permalink
Replaced deprecated/removed imghdr with puremagic package
Browse files Browse the repository at this point in the history
It was deprecated in Python 3.11 and removed in Python 3.13

https://peps.python.org/pep-0594/#deprecated-modules
  • Loading branch information
mr-c committed Nov 15, 2024
1 parent 964c95c commit 19dec44
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion mayavi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
'traits>=6.0.0',
'traitsui>=7.0.0',
'packaging',
'vtk'
'vtk',
'puremagic'
]

__extras_require__ = {
Expand Down
4 changes: 2 additions & 2 deletions mayavi/tools/remote/remote_widget.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import imghdr
import puremagic


class RemoteWidget(object):
Expand Down Expand Up @@ -50,7 +50,7 @@ def show_image(self, data, format='PNG'):

def _update_image(self):
data = self.scene_proxy.get_raw_image()
format = imghdr.what('', h=data)
format = puremagic.what('', h=data)
self.show_image(data, format=format.upper())

# ##### VTK Event handling ##########
Expand Down

0 comments on commit 19dec44

Please sign in to comment.