1. Sam Skillman
  2. yt

Commits

Sam Skillman  committed f5cf965

Fixing my_version property after suggestions from @matthewturk

  • Participants
  • Parent commits 849c77e
  • Branches yt

Comments (0)

Files changed (1)

File yt/utilities/answer_testing/framework.py

View file
 
     @property
     def my_version(self, version=None):
-        if self._my_version is None:
-            if version is not None:
-                self._my_version = version
-            else:
-                try:
-                    self._my_version = get_yt_version()
-                except:
-                    self._my_version = "UNKNOWN%s" % (time.time())
-        else:
+        if self._my_version is not None:
             return self._my_version
+        if version is None:
+            try:
+                version = get_yt_version()
+            except:
+                version = "UNKNOWN%s" % (time.time())
+        self._my_version = version
+        return self._my_version
 
     def configure(self, options, conf):
         super(AnswerTesting, self).configure(options, conf)