Skip to content

Commit 53a7c2c

Browse files
committed
Fix flake8 errors reported in python 3.12
1 parent f76f131 commit 53a7c2c

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

build.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,23 +132,23 @@ def FindLatestMSVC( quiet ):
132132
try:
133133
latest_v = int( latest_full_v.split( '.' )[ 0 ] )
134134
except ValueError:
135-
raise ValueError( f"{latest_full_v} is not a version number." )
135+
raise ValueError( f"{ latest_full_v } is not a version number." )
136136

137137
if not quiet:
138-
print( f'vswhere -latest returned version {latest_full_v}' )
138+
print( f'vswhere -latest returned version { latest_full_v }' )
139139

140140
if latest_v not in ACCEPTABLE_VERSIONS:
141141
if latest_v > 17:
142142
if not quiet:
143-
print( f'MSVC Version {latest_full_v} is newer than expected.' )
143+
print( f'MSVC Version { latest_full_v } is newer than expected.' )
144144
else:
145145
raise ValueError(
146-
f'vswhere returned {latest_full_v} which is unexpected.'
146+
f'vswhere returned { latest_full_v } which is unexpected.'
147147
'Pass --msvc <version> argument.' )
148148
return latest_v
149149
else:
150150
if not quiet:
151-
print( f'vswhere returned nothing usable, {latest_full_v}' )
151+
print( f'vswhere returned nothing usable, { latest_full_v }' )
152152

153153
# Fall back to registry parsing, which works at least until MSVC 2019 (16)
154154
# but is likely failing on MSVC 2022 (17)
@@ -161,11 +161,11 @@ def FindLatestMSVC( quiet ):
161161
for i in ACCEPTABLE_VERSIONS:
162162
if not quiet:
163163
print( 'Trying to find '
164-
rf'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\{i}.0' )
164+
rf'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\{ i }.0' )
165165
try:
166-
winreg.OpenKey( handle, rf'SOFTWARE\Microsoft\VisualStudio\{i}.0' )
166+
winreg.OpenKey( handle, rf'SOFTWARE\Microsoft\VisualStudio\{ i }.0' )
167167
if not quiet:
168-
print( f"Found MSVC version {i}" )
168+
print( f"Found MSVC version { i }" )
169169
msvc = i
170170
break
171171
except FileNotFoundError:
@@ -978,7 +978,7 @@ def EnableRustCompleter( switches ):
978978
req_toolchain_version = switches.rust_toolchain_version
979979

980980
if switches.quiet:
981-
sys.stdout.write( f'Installing rust-analyzer "{req_toolchain_version}" '
981+
sys.stdout.write( f'Installing rust-analyzer "{ req_toolchain_version }" '
982982
'for Rust support...' )
983983
sys.stdout.flush()
984984

ycmd/completers/cs/solutiondetection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def _SolutionTestCheckHeuristics( candidates, tokens, i ):
9393
# 1. is there a solution named just like the subdirectory with the source?
9494
if ( not selection and i < len( tokens ) - 1 and
9595
f'{ tokens[ i + 1 ] }.sln' in candidates ):
96-
selection = os.path.join( path, f'{ tokens[ i + 1] }.sln' )
96+
selection = os.path.join( path, f'{ tokens[ i + 1 ] }.sln' )
9797
LOGGER.info( 'Selected solution file %s as it matches source subfolder',
9898
selection )
9999

ycmd/completers/typescript/typescript_completer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def _StartServerNoLock( self ):
214214
return
215215

216216
self._logfile = utils.CreateLogfile( LOGFILE_FORMAT )
217-
tsserver_log = f'-file { self._logfile } -level {_LogLevel()}'
217+
tsserver_log = f'-file { self._logfile } -level { _LogLevel() }'
218218
# TSServer gets the configuration for the log file through the
219219
# environment variable 'TSS_LOG'. This seems to be undocumented but
220220
# looking at the source code it seems like this is the way:
@@ -911,7 +911,7 @@ def _GetDoc( self, request_data ):
911911
'offset': request_data[ 'column_codepoint' ]
912912
} )
913913

914-
message = f'{ info[ "displayString" ] }\n\n{info[ "documentation" ]}'
914+
message = f'{ info[ "displayString" ] }\n\n{ info[ "documentation" ] }'
915915
return responses.BuildDetailedInfoResponse( message )
916916

917917

0 commit comments

Comments
 (0)