mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-21 00:19:42 +02:00
add 'str' type check on input
This commit is contained in:
@ -205,7 +205,7 @@ import jc.utils
|
||||
|
||||
class info:
|
||||
"""Provides parser metadata (version, author, etc.)"""
|
||||
version = "1.0"
|
||||
version = "1.1"
|
||||
description = "`systeminfo` command parser"
|
||||
author = "Jon Smith"
|
||||
author_email = "jon@rebelliondefense.com"
|
||||
@ -303,8 +303,8 @@ def parse(data, raw=False, quiet=False):
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
"""
|
||||
if not quiet:
|
||||
jc.utils.compatibility(__name__, info.compatible)
|
||||
if not quiet: jc.utils.compatibility(__name__, info.compatible)
|
||||
if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.")
|
||||
|
||||
delim = ":" # k/v delimiter
|
||||
raw_data = {} # intermediary output
|
||||
|
Reference in New Issue
Block a user