1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
Description: patch for compatibility with python 3.8
Author: Étienne Mollier <etienne.mollier@mailoo.org>
Bug: https://github.com/qiime2/qiime2/issues/520
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=950842
Last-Update: 2020-11-30
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
@@ -154,6 +154,14 @@ class InternalDirectory(_ConcretePath):
# Same reasoning as truediv
return _ConcretePath(path, str(self))
+ def rename(self, path):
+ # We don't want to rename and lose the target right away.
+ # This overrides post python3.8 behavior.
+ _ConcretePath(str(self)).rename(path)
+
+ def replace(self, path):
+ # Same reasoning as replace
+ _ConcretePath(str(self)).replace(path)
class ArchivePath(InternalDirectory):
DEFAULT_PREFIX = 'qiime2-archive-'
@@ -93,6 +93,9 @@ def _convert_literals(expr):
if node is ast.Name and expr.id == 'inf':
return float('inf')
+ if node is ast.Constant:
+ return expr.value
+
raise ValueError("Unknown literal: %r" % node)
|