diff --git a/NEWS b/NEWS index 0ad9b52e6d56718e21f3a782ae2f3242bfa52860..37f693eb544cb8a9297fa8b19bf6994eb5926998 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ Enhancements and new features: Bugs corrected: * TypeError: '<' not supported between instances of 'float' and 'str' #1315 + * Glances IO Errorno 22 - Invalid argument #1326 Version 3.0.1 ============= diff --git a/glances/standalone.py b/glances/standalone.py index 8399c6fddb102cec37e4e51013233a22c4eec6ab..7feab3006368fa11de27846e99b5336f9b6273da 100644 --- a/glances/standalone.py +++ b/glances/standalone.py @@ -119,17 +119,20 @@ class GlancesStandalone(object): self.stats.export(self.stats) logger.debug('Stats exported in {} seconds'.format(counter_export.get())) + # Patch for issue1326 to avoid < 0 refresh + adapted_refresh = self.refresh_time - counter.get() + adapted_refresh = adapted_refresh if adapted_refresh > 0 else 0 + # Display stats # and wait refresh_time - counter if not self.quiet: # The update function return True if an exit key 'q' or 'ESC' # has been pressed. - ret = not self.screen.update(self.stats, - duration=self.refresh_time - counter.get()) + ret = not self.screen.update(self.stats, duration=adapted_refresh) else: # Nothing is displayed # Break should be done via a signal (CTRL-C) - time.sleep(self.refresh_time - counter.get()) + time.sleep(adapted_refresh) ret = True return ret