Skip to content

Commit

Permalink
Merge pull request conda#9764 from isuruf/pypy
Browse files Browse the repository at this point in the history
Support running conda in PyPy
  • Loading branch information
jjhelmus authored Mar 17, 2020
2 parents 9938b07 + 93e3b7a commit df77c06
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion conda/base/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from enum import Enum, EnumMeta
from os.path import join
import struct

from ..common.compat import itervalues, on_win, six_with_metaclass, string_types

Expand All @@ -20,7 +21,7 @@
# this program on itself will leave it unchanged
'anaconda3')

machine_bits = 8 * tuple.__itemsize__
machine_bits = 8 * struct.calcsize("P")

APP_NAME = 'conda'

Expand Down
3 changes: 2 additions & 1 deletion conda/base/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from os.path import abspath, basename, expanduser, isdir, isfile, join, split as path_split
import platform
import sys
import struct

from .constants import (APP_NAME, ChannelPriority, DEFAULTS_CHANNEL_NAME, REPODATA_FN,
DEFAULT_AGGRESSIVE_UPDATE_PACKAGES, DEFAULT_CHANNELS,
Expand Down Expand Up @@ -474,7 +475,7 @@ def bits(self):
if self.force_32bit:
return 32
else:
return 8 * tuple.__itemsize__
return 8 * struct.calcsize("P")

@property
def root_dir(self):
Expand Down
3 changes: 2 additions & 1 deletion conda/core/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
from random import randint
import re
import sys
import struct

try:
FileNotFoundError
Expand Down Expand Up @@ -788,7 +789,7 @@ def make_entry_point(target_path, conda_prefix, module, func):
def make_entry_point_exe(target_path, conda_prefix):
# target_path: join(conda_prefix, 'Scripts', 'conda.exe')
exe_path = target_path
bits = 8 * tuple.__itemsize__
bits = 8 * struct.calcsize("P")
source_exe_path = join(CONDA_PACKAGE_ROOT, 'shell', 'cli-%d.exe' % bits)
if isfile(exe_path):
if compute_md5sum(exe_path) == compute_md5sum(source_exe_path):
Expand Down

0 comments on commit df77c06

Please sign in to comment.