Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8c2a691

Browse files
committed
updated win32 setupext for python2.2
svn path=/trunk/matplotlib/; revision=496
1 parent 34e79ca commit 8c2a691

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

examples/simple_plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
figure(1)
66
t = arange(0.0, 1.0, 0.01)
7-
s = sin(2*2*pi*t)
7+
s = cos(2*2*pi*t)
88
plot(t, s)
99

1010
xlabel('time (s)')

setupext.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,20 @@ def find_tcltk():
209209
def add_tk_flags(module):
210210
'Add the module flags to build extensions which use tk'
211211
if sys.platform=='win32':
212-
module.include_dirs.extend(['win32_static/include/tcl'])
213-
module.library_dirs.extend(['C:/Python23/dlls'])
214-
module.libraries.extend(['tk84', 'tcl84'])
212+
major, minor1, minor2, s, tmp = sys.version_info
213+
print 'building tkagg', major, minor1
214+
if major==2 and minor1==3:
215+
print '\tBuilding for python23'
216+
module.include_dirs.extend(['win32_static/include/tcl84'])
217+
module.library_dirs.extend(['C:/Python23/dlls'])
218+
module.libraries.extend(['tk84', 'tcl84'])
219+
elif major==2 and minor1==2:
220+
print '\tBuilding for python22'
221+
module.include_dirs.extend(['win32_static/include/tcl83'])
222+
module.library_dirs.extend(['C:/Python22/dlls'])
223+
module.libraries.extend(['tk83', 'tcl83'])
224+
else:
225+
raise RuntimeError('No tk/win32 support for this python version yet')
215226
return
216227

217228
elif sys.platform == 'darwin' :

0 commit comments

Comments
 (0)