Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GameTime.get_wallclocktime() should return a datetime object #1110

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Daraan
Copy link
Contributor

@Daraan Daraan commented Aug 27, 2024

Description

When using self.wallclock_t0 = GameTime.get_wallclocktime(), which returns _platform_timestamp a type-checker complains that the type used afterwards is int | datetime.datetime, however it is never used as int this is just the intial value. This minimal PR unifies the type to be always a datetime object.

- _platform_timestamp = 0
+ _platform_timestamp = datetime.datetime.fromtimestamp(0)

Where has this been tested?

  • Platform(s): Ubuntu 22.04
  • Python version(s): 3.7 & 3.10
  • Unreal Engine version(s):
  • CARLA version: 0.9.15 dev

Possible Drawbacks


This change is Reviewable

@Daraan Daraan changed the title timestamp is always datetime GameTime.get_wallclocktime() should return a datetime object Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant