Skip to content

Commit

Permalink
Get ipython to work again in 3.9 (#6603)
Browse files Browse the repository at this point in the history
  • Loading branch information
rchiodo authored Jul 13, 2021
1 parent 5f6f82a commit f08d6e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
7 changes: 0 additions & 7 deletions Python/Product/Core/Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,4 @@
<Compile Include="ProvideRawCodeBaseAttribute.cs" />
</ItemGroup>
<Import Project="..\ProjectAfter.settings" />
<!-- Temporary workaround for the interop DLL not being available in 15.5 -->
<Target Name="_IncludeVSCodeInterop" Condition="!$(ReleaseBuild) and $(DeployExtension)" BeforeTargets="BeforeBuild">
<ItemGroup>
<_InteropDll Include="$(DevEnvDir)Extensions\*\Microsoft.VisualStudio.Debugger.DebugAdapterHost.Interfaces.dll" />
<Content Include="..\..\References\Dev$(VSTarget)\Microsoft.VisualStudio.Debugger.DebugAdapterHost.Interfaces.dll;VSCodeInterop.pkgdef" Condition="@(_InteropDll) == ''" />
</ItemGroup>
</Target>
</Project>
9 changes: 6 additions & 3 deletions Python/Product/PythonTools/ptvsd/repl/ipython_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
except:
import _thread as thread # Renamed as Py3k

from base64 import decodestring
try:
from base64 import decodestring
except:
from base64 import decodebytes as decodestring # Deprecated in 3.9

try:
import IPython
Expand Down Expand Up @@ -185,7 +188,7 @@ def write_data(self, data, execution_count = None):
try:
if isinstance(output_xaml, str) and sys.version_info[0] >= 3:
output_xaml = output_xaml.encode('ascii')
self._vs_backend.write_xaml(decodestring(output_xaml))
self._vs_backend.write_xaml(str(decodestring(output_xaml)))
self._vs_backend.write_stdout('\n')
return
except:
Expand All @@ -196,7 +199,7 @@ def write_data(self, data, execution_count = None):
try:
if isinstance(output_png, str) and sys.version_info[0] >= 3:
output_png = output_png.encode('ascii')
self._vs_backend.write_png(decodestring(output_png))
self._vs_backend.write_png(str(decodestring(output_png)))
self._vs_backend.write_stdout('\n')
return
except:
Expand Down

0 comments on commit f08d6e1

Please sign in to comment.