File: testrc.py

package info (click to toggle)
rl-accel 0.9.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 156 kB
  • sloc: ansic: 1,199; python: 101; makefile: 4
file content (21 lines) | stat: -rw-r--r-- 585 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from sys import getrefcount
from _rl_accel import unicode2T1

utext = 'This is the end of the world'

class Font:
    def __init__(self,name):
        self.fontName = name
        self.substitutionFonts = []
        self.encName = 'utf8'

font = Font('Helvetica')

defns = 'utext font font.encName font.fontName font.substitutionFonts'.split()
rc0 = [getrefcount(eval(x,globals())) for x in defns]
print(rc0)
unicode2T1(utext,[font]+font.substitutionFonts)
rc1 = [getrefcount(eval(x,globals())) for x in defns]
print(rc1)
if rc1!=rc0:
    print('!!!!! reference counts changed !!!!!')