Opened 5 years ago

Closed 5 years ago

#4011 closed defect (fixed)

Python 3.8 SyntaxWarnings

Reported by: hcho Owned by: grass-dev@…
Priority: normal Milestone:
Component: wxGUI Version: svn-trunk
Keywords: Cc:
CPU: Unspecified Platform: All

Description

I'm on Python 3.8 on Windows. Looks like this syntax warning is new for 3.8: "is" with a literal. Did you mean "=="?. Also, there seems to be no time.clock anymore.

Starting GRASS GIS...
D:\opt\grass\gui\wxpython\gui_core\gselect.py:1868: SyntaxWarning: "is" with a l
iteral. Did you mean "=="?
  self.changingSizer.Show(self.dbPanel, show=(sourceType is 'db'))
WARNING: Concurrent mapset locking is not supported on Windows
Cleaning up temporary files...

          __________  ___   __________    _______________
         / ____/ __ \/   | / ___/ ___/   / ____/  _/ ___/
        / / __/ /_/ / /| | \__ \\_  \   / / __ / / \__ \
       / /_/ / _, _/ ___ |___/ /__/ /  / /_/ // / ___/ /
       \____/_/ |_/_/  |_/____/____/   \____/___//____/

Welcome to GRASS GIS 7.9.dev (a97655792)
GRASS GIS homepage:                      https://grass.osgeo.org
This version running through:            Command Prompt (C:\Windows\system32\cmd
.exe)
Help is available with the command:      g.manual -i
See the licence terms with:              g.version -c
See citation options with:               g.version -x
If required, restart the GUI with:       g.gui wxpython
When ready to quit enter:                exit

Launching <wxpython> GUI in the background, please wait...
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
Clink v0.4.9 [git:2fd2c2] Copyright (c) 2012-2016 Martin Ridgers
http://mridgers.github.io/clink


D:\grassdata>D:\opt\grass\gui\wxpython\core\gconsole.py:600: SyntaxWarning: "is"
 with a literal. Did you mean "=="?
  if line[0] is '#' and line[1] is '%':
D:\opt\grass\gui\wxpython\core\gconsole.py:600: SyntaxWarning: "is" with a liter
al. Did you mean "=="?
  if line[0] is '#' and line[1] is '%':
Traceback (most recent call last):
  File "D:\opt\grass\gui\wxpython\mapwin\buffered.py", line 640, in OnSize
    self.resize = time.clock()
AttributeError: module 'time' has no attribute 'clock'
Traceback (most recent call last):
  File "D:\opt\grass\gui\wxpython\mapwin\buffered.py", line 640, in OnSize
    self.resize = time.clock()
AttributeError: module 'time' has no attribute 'clock'
Traceback (most recent call last):
  File "D:\opt\grass\gui\wxpython\mapwin\buffered.py", line 640, in OnSize
    self.resize = time.clock()
AttributeError: module 'time' has no attribute 'clock'
Traceback (most recent call last):
  File "D:\opt\grass\gui\wxpython\mapwin\buffered.py", line 640, in OnSize
    self.resize = time.clock()
AttributeError: module 'time' has no attribute 'clock'

D:\grassdata>

Change History (5)

comment:1 by neteler, 5 years ago

AFAIK this is addressed in https://github.com/OSGeo/grass/pull/244

Could you pls test it and leave feedback in the PR?

comment:2 by hcho, 5 years ago

Yes, the time.clock error is gone, but not is with a literal.

comment:3 by hcho, 5 years ago

Just created a new PR for this: https://github.com/OSGeo/grass/pull/264

comment:4 by neteler, 5 years ago

Seems to be all fixed and backported to relbranch78?

comment:5 by hcho, 5 years ago

Resolution: fixed
Status: newclosed

Yes, closing the ticket.

Note: See TracTickets for help on using tickets.