Commit 5d46d44b authored by Hartmut Goebel's avatar Hartmut Goebel
Browse files

Release 0.8.1.

parents 37622fb3 ca04f849
Loading
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
Changes
==================

0.8.1 (2025-05-28)
------------------

Bugfixes:

* Fix crash on Windows for Python >= 3.12, caused by
  distutils module been removed from Python 3.12.


0.8 (2025-05-28)
----------------

+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ Python-Interface to the Ghostscript C-API
---------------------------------------------------------------------

:Author:  Hartmut Goebel <h.goebel@crazy-compiler.com>
:Version: 0.8
:Version: 0.8.1
:License: GNU General Public License v3 or later (GPLv3+)
:Homepage: https://gitlab.com/pdftools/python-ghostscript

+16 −13
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ ghostscript._gsprint - A low-lewel interface to the Ghostscript C-API using ctyp
__author__ = "Hartmut Goebel <h.goebel@crazy-compilers.com>"
__copyright__ = "Copyright 2010-2023 by Hartmut Goebel <h.goebel@crazy-compilers.com>"
__licence__ = "GNU General Public License version 3 (GPL v3)"
__version__ = "0.8"
__version__ = "0.8.1"

from ctypes import *
import sys
@@ -499,18 +499,21 @@ def set_display_callback(instance, callback):


def __win32_finddll():
    try:
        import winreg
    except ImportError:
        # assume Python 2
        from _winreg import OpenKey, CloseKey, EnumKey, QueryValueEx, \
            QueryInfoKey, HKEY_LOCAL_MACHINE
    else:
    import os
    import re
    from winreg import OpenKey, CloseKey, EnumKey, QueryValueEx, \
        QueryInfoKey, HKEY_LOCAL_MACHINE

    from distutils.version import LooseVersion
    import os
    def looseVersion(vstring):
        # Taken from distutils.LooseVersion.parse()
        component_re = re.compile(r'(\d+ | [a-z]+ | \.)', re.VERBOSE)
        components = [x for x in component_re.split(vstring) if x and x != '.']
        for i, obj in enumerate(components):
            try:
                components[i] = int(obj)
            except ValueError:
                pass
        return components

    dlls = []
    # Look up different variants of Ghostscript and take the highest
@@ -526,7 +529,7 @@ def __win32_finddll():
                    dll_path = QueryValueEx(k2, 'GS_DLL')[0]
                    CloseKey(k2)
                    if os.path.exists(dll_path):
                        dlls.append((LooseVersion(version), dll_path))
                        dlls.append((looseVersion(version), dll_path))
                except WindowsError:
                    pass
            CloseKey(k1)