From 20c1d95b45ae86678c748d5046de7bae8843e4a7 Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Thu, 14 Dec 2017 13:32:52 +0100 Subject: Fix version check --- mastodon/Mastodon.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'mastodon') diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index b276291..2d51561 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -44,16 +44,16 @@ def api_version(created_ver, last_changed_ver): def wrapper(function, self, *args, **kwargs): if not self.version_check_mode == "none": if self.version_check_mode == "created": - version = created_version + version = created_ver else: version = last_changed_ver - major, minor, patch = parse_version_string(version) - if major > self.mastodon_major: - raise MastodonVersionError("Version check failed (Need version " + version + ")") - elif major == self.mastodon_major and minor > self.mastodon_minor: - raise MastodonVersionError("Version check failed (Need version " + version + ")") - elif major == self.mastodon_major and minor == self.mastodon_minor and patch > self.mastodon_patch: - raise MastodonVersionError("Version check failed (Need version " + version + ")") + major, minor, patch = parse_version_string(version) + if major > self.mastodon_major: + raise MastodonVersionError("Version check failed (Need version " + version + ")") + elif major == self.mastodon_major and minor > self.mastodon_minor: + raise MastodonVersionError("Version check failed (Need version " + version + ")") + elif major == self.mastodon_major and minor == self.mastodon_minor and patch > self.mastodon_patch: + raise MastodonVersionError("Version check failed (Need version " + version + ")") return function(self, *args, **kwargs) function.__doc__ = function.__doc__ + "\n\n *Added: Mastodon v" + created_ver + ", last changed: Mastodon v" + last_changed_ver + "*" return decorate(function, wrapper) -- cgit v1.2.3