Skip to content

Commit

Permalink
Fix version on Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
dnicolson authored Jan 30, 2024
1 parent 60d0c32 commit 4ca9624
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions kin/kin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import sys
import os
from pkg_resources import get_distribution
from .verifier import Verifier
from .grammar.PBXProjLexer import PBXProjLexer
from .grammar.PBXProjParser import PBXProjParser
Expand All @@ -28,14 +27,19 @@ def find_target_files():


def print_help():
version = get_distribution('kin').version
try:
from pkg_resources import get_distribution # Python 3.7-3.9
version = get_distribution('kin').version
except ImportError:
import importlib.metadata # Python 3.10+
version = importlib.metadata.version('kin')

print(("USAGE: kin [file]\n" +
"DESCRIPTION: Verifies the correctness of your project.pbxproj " +
"file. If no arguments are supplied, Kin will try to find a " +
"project.pbxproj file in the current project.\nARGUMENTS:\n" +
"\t- file\tOptionally provides the location of your " +
"project.pbxproj file\n\n" +
"project.pbxproj file\n\n" +
"VERSION: " + version))


Expand Down

0 comments on commit 4ca9624

Please sign in to comment.