@@ -521,18 +521,20 @@ def patch_standard_packages(
521
521
"""patch Winpython packages in need"""
522
522
import filecmp
523
523
524
+ # Adpating to PyPy
525
+ if 'pypy3' in osp .basename (utils .get_python_executable (self .target )):
526
+ site_package_place = "\\ site-packages\\ "
527
+ else :
528
+ site_package_place = "\\ Lib\\ site-packages\\ "
529
+
530
+
524
531
# 'pywin32' minimal post-install (pywin32_postinstall.py do too much)
525
532
if (
526
533
package_name .lower () == "pywin32"
527
534
or package_name == ''
528
535
):
529
- origin = self .target + (
530
- r"\Lib\site-packages\pywin32_system32"
531
- )
532
- if 'pypy3' in sys .executable :
533
- origin = self .target + (
534
- r"\site-packages\pywin32_system32"
535
- )
536
+ origin = self .target + site_package_place + "pywin32_system32"
537
+
536
538
destin = self .target
537
539
if osp .isdir (origin ):
538
540
for name in os .listdir (origin ):
@@ -556,10 +558,9 @@ def patch_standard_packages(
556
558
sheb_fix = " executable = get_executable()"
557
559
sheb_mov1 = " executable = os.path.join(os.path.basename(get_executable()))"
558
560
sheb_mov2 = " executable = os.path.join('..',os.path.basename(get_executable()))"
559
- if 'pypy3' in sys .executable :
560
- the_place = r"\site-packages\pip\_vendor\distlib\scripts.py"
561
- else :
562
- the_place = r"\Lib\site-packages\pip\_vendor\distlib\scripts.py"
561
+
562
+ # Adpating to PyPy
563
+ the_place = site_package_place + r"pip\_vendor\distlib\scripts.py"
563
564
print (the_place )
564
565
if to_movable :
565
566
utils .patch_sourcefile (
@@ -591,7 +592,7 @@ def patch_standard_packages(
591
592
# will be in standard pip 8.0.3
592
593
utils .patch_sourcefile (
593
594
self .target
594
- + (r"\Lib\site-packages\ pip\wheel.py" ),
595
+ + (site_package_place + r" pip\wheel.py" ),
595
596
" writer.writerow((f, h, l))" ,
596
597
" writer.writerow((normpath(f, lib_dir), h, l))" ,
597
598
)
@@ -606,15 +607,15 @@ def patch_standard_packages(
606
607
utils .patch_sourcefile (
607
608
self .target
608
609
+ (
609
- r"\Lib\site-packages\ spyderlib\config\main.py"
610
+ site_package_place + r" spyderlib\config\main.py"
610
611
),
611
612
"'check_updates_on_startup': True," ,
612
613
"'check_updates_on_startup': False," ,
613
614
)
614
615
utils .patch_sourcefile (
615
616
self .target
616
617
+ (
617
- r"\Lib\site-packages\ spyder\config\main.py"
618
+ site_package_place + r" spyder\config\main.py"
618
619
),
619
620
"'check_updates_on_startup': True," ,
620
621
"'check_updates_on_startup': False," ,
0 commit comments