From fdec758113e3e0782241d7d1a94d4a0c8a611215 Mon Sep 17 00:00:00 2001 From: ines Date: Sat, 25 Mar 2017 14:04:02 +0100 Subject: [PATCH] Add is_windows and is_python2 utility functions --- spacy/util.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spacy/util.py b/spacy/util.py index 893ba87c1..6c25ce0e8 100644 --- a/spacy/util.py +++ b/spacy/util.py @@ -153,6 +153,16 @@ def check_renamed_kwargs(renamed, kwargs): raise TypeError("Keyword argument %s now renamed to %s" % (old, new)) +def is_windows(): + """Check if user is on Windows.""" + return sys.platform.startswith('win') + + +def is_python2(): + """Check if Python 2 is used.""" + return sys.version.startswith('2.') + + def parse_package_meta(package_path, package, require=True): location = os.path.join(str(package_path), package, 'meta.json') if os.path.isfile(location):