-def get_terminal_width():
- """Return the current terminal dimensions."""
- try:
- from struct import pack, unpack
- from fcntl import ioctl
- from termios import TIOCGWINSZ
- s = pack('HHHH', 0, 0, 0, 0)
- return unpack('HHHH', ioctl(sys.stdout.fileno(), TIOCGWINSZ, s))[1]
- except:
- return 80
+# tell distribute to use 2to3 with our own fixers.
+extra = {}
+if sys.version_info >= (3, 0):
+ extra.update(
+ use_2to3=True,
+ use_2to3_fixers=['custom_fixers']
+ )
+
+# ignore the old '--with-speedups' flag
+try:
+ speedups_pos = sys.argv.index('--with-speedups')
+except ValueError:
+ pass
+else:
+ sys.argv[speedups_pos] = '--with-debugsupport'
+ sys.stderr.write('*' * 74 + '\n')
+ sys.stderr.write('WARNING:\n')
+ sys.stderr.write(' the --with-speedups flag is deprecated, assuming '
+ '--with-debugsupport\n')
+ sys.stderr.write(' For the actual speedups install the MarkupSafe '
+ 'package.\n')
+ sys.stderr.write('*' * 74 + '\n')