Skip to content

Commit

Permalink
Merge pull request #937 from hroncok/mac_bytes
Browse files Browse the repository at this point in the history
Put bytes instead of str to CoreFoundation.CFStringCreateWithCString
  • Loading branch information
kliment committed May 11, 2018
2 parents eefc58f + 3a37b24 commit 347262c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions printrun/power/osx.py
Expand Up @@ -41,6 +41,7 @@ def StringToCFString(string):
encoding = CoreFoundation.kCFStringEncodingASCII
except AttributeError:
encoding = 0x600
string = string.encode('ascii')
cfstring = CoreFoundation.CFStringCreateWithCString(None, string, encoding)
return objc.pyobjc_id(cfstring.nsstring())

Expand Down

0 comments on commit 347262c

Please sign in to comment.