Skip to content

Commit 1af0acb

Browse files
committed
Drop basestring type comparison for Python 2
1 parent 8f17355 commit 1af0acb

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

pre_commit_hooks/check_munkipkg_buildinfo.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,21 @@ def build_argument_parser():
3131
def validate_buildinfo_key_types(buildinfo, filename):
3232
"""Ensure build-info files contain the proper types."""
3333

34-
# Remap string type to support unicode in both Python 2 and 3
35-
# DEPRECATED: Python 2 support will be removed in the future
36-
string = basestring if sys.version_info.major == 2 else str
37-
3834
# Pkginfo keys and their known types. Omitted keys are left unvalidated.
3935
# Source: https://github.com/munki/munki-pkg
4036
# Last updated 2019-06-27.
4137
buildinfo_types = {
4238
"distribution_style": bool,
43-
"identifier": string,
44-
"install_location": string,
45-
"name": string,
46-
"ownership": string,
47-
"postinstall_action": string,
39+
"identifier": str,
40+
"install_location": str,
41+
"name": str,
42+
"ownership": str,
43+
"postinstall_action": str,
4844
"preserve_xattr": bool,
49-
"product id": string,
45+
"product id": str,
5046
"signing_info": dict,
5147
"suppress_bundle_relocation": bool,
52-
"version": string,
48+
"version": str,
5349
}
5450

5551
passed = True

0 commit comments

Comments
 (0)