Skip to content

Commit a563dd0

Browse files
author
Bernat Zaragoza Travieso
committed
Fix mprof command not working in Windows
Adds mprof.bat to python scripts so the mprof command can be executed
1 parent ba586d1 commit a563dd0

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

mprof.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
python %~dpn0 %*

setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import io
33
import re
4+
import sys
45
from setuptools import setup
56

67

@@ -39,6 +40,10 @@ def find_version(*file_paths):
3940
4041
"""
4142

43+
scripts = ['mprof']
44+
if sys.platform == "win32":
45+
scripts.append('mprof.bat')
46+
4247
setup(
4348
name='memory_profiler',
4449
description='A module for monitoring memory usage of a python program',
@@ -48,7 +53,7 @@ def find_version(*file_paths):
4853
author_email='f@bianp.net',
4954
url='http://pypi.python.org/pypi/memory_profiler',
5055
py_modules=['memory_profiler'],
51-
scripts=['mprof'],
56+
scripts=scripts,
5257
install_requires=['psutil'],
5358
classifiers=[_f for _f in CLASSIFIERS.split('\n') if _f],
5459
license='BSD'

0 commit comments

Comments
 (0)