Skip to content

Commit

Permalink
Fix errors with Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
yibe committed May 10, 2024
1 parent 528d962 commit a75c3d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ldoce5viewer/ldoce5/idmreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from struct import unpack
from zlib import decompress
try:
from configparser import SafeConfigParser
from configparser import ConfigParser
except:
from ConfigParser import SafeConfigParser
from ConfigParser import SafeConfigParser as ConfigParser

try:
import __builtin__
Expand Down Expand Up @@ -82,7 +82,7 @@ def is_ldoce5_dir(path):
def list_files(data_root, archive_name):

def _parse_cft(path):
cp = SafeConfigParser()
cp = ConfigParser()
with open(path, 'r') as f:
cp.readfp(f)
r = {}
Expand Down
4 changes: 2 additions & 2 deletions ldoce5viewer/qtgui/access.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from __future__ import print_function

import sys
import imp
import _imp
import mimetypes
import os.path
import traceback
Expand Down Expand Up @@ -32,7 +32,7 @@ def _load_static_data(filename):
"""Load a static file from the 'static' directory"""

is_frozen = (hasattr(sys, 'frozen') # new py2exe
or imp.is_frozen('__main__')) # tools/freeze
or _imp.is_frozen('__main__')) # tools/freeze

if is_frozen:
if sys.platform.startswith("darwin"):
Expand Down

0 comments on commit a75c3d5

Please sign in to comment.