From ef51e290cc852fb997dca7ab7606dedd8f9b8e55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Klap=C3=A1lek?= Date: Tue, 17 Oct 2023 12:37:43 +0200 Subject: [PATCH 1/2] (F) node: Properly set Time.now workaround It actually depends on the Python version. In Python 2 you can directly set attributes of a method function, while this is forbidden in Python 3. But it can be also related to term like "unbound method", which was not a thing before. --- CHANGELOG.md | 4 ++++ autopsy/node.py | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31257fe..ef7fc99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/). ## Unreleased +### Fixed +- `uninode` + - `Time.now()` is now properly set in Python 3. + ## 0.9.4 - 2023-10-11 ### Added - `uninode`: diff --git a/autopsy/node.py b/autopsy/node.py index d40615a..2b1b14f 100644 --- a/autopsy/node.py +++ b/autopsy/node.py @@ -117,7 +117,12 @@ def __init__(self, name): super(Node, self).__init__(name) # Workaround for Time.now() - self.Time.now = super(Node, self).get_clock().now + try: + # Python 2 + self.Time.now = super(Node, self).get_clock().now + except: + # Python 3 + self.Time.__func__.now = super(Node, self).get_clock().now def Publisher(self, name, data_class, subscriber_listener=None, tcp_nodelay=False, latch=False, headers=None, queue_size=None): From aac671e0a8e45fb932d9b7a4d72c9fd6a0dfbbd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Klap=C3=A1lek?= Date: Tue, 17 Oct 2023 12:39:52 +0200 Subject: [PATCH 2/2] Release version 0.9.5 --- CHANGELOG.md | 1 + package.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef7fc99..e3b35f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/). ## Unreleased +## 0.9.5 - 2023-10-17 ### Fixed - `uninode` - `Time.now()` is now properly set in Python 3. diff --git a/package.xml b/package.xml index c66f0d1..c7cc061 100644 --- a/package.xml +++ b/package.xml @@ -4,7 +4,7 @@ schematypens="http://www.w3.org/2001/XMLSchema"?> autopsy - 0.9.4 + 0.9.5 A set of Python utils for F1Tenth project. Jaroslav Klapálek