diff --git a/pym/cl_utils.py b/pym/cl_utils.py index b84d6e6..d6fa979 100644 --- a/pym/cl_utils.py +++ b/pym/cl_utils.py @@ -28,7 +28,11 @@ import re import sys import getpass from types import StringType -import magic as type_file + +try: + from magic import open as type_file, MAGIC_NONE as MAGIC_NONE +except ImportError: + from magic import open as type_file, NONE as MAGIC_NONE import cl_lang tr = cl_lang.lang() @@ -73,7 +77,7 @@ class typeFile: """Получение типа файла""" def __init__(self, magic=0x410): - self.magicObject = type_file.open(type_file.MAGIC_NONE) + self.magicObject = type_file(MAGIC_NONE) self.magicObject.load() self.magicObject.setflags(magic)