Skip to content

Commit a0007d2

Browse files
Merge remote-tracking branch 'remotes/origin/master' into pkcs11
2 parents 5fdf6fa + 90591bb commit a0007d2

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

lib/CMakeLists.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 2.6.4)
1+
cmake_minimum_required(VERSION 3.1.0)
22
project(cryptoauth)
33

44
# Various Options for Build
@@ -85,6 +85,8 @@ endif()
8585

8686
add_library(cryptoauth ${CRYPTOAUTH_SRC} ${ATCACERT_DEF_SRC})
8787

88+
set_property(TARGET cryptoauth PROPERTY C_STANDARD 99)
89+
8890
if(ATCA_PRINTF)
8991
add_definitions(-DATCAPRINTF)
9092
endif(ATCA_PRINTF)
@@ -106,7 +108,7 @@ if(LINUX)
106108
add_definitions(-DATCA_USE_SHARED_MUTEX)
107109
if(HAS_LIBUSB AND ATCA_HAL_KIT_HID)
108110
target_link_libraries(cryptoauth usb-1.0)
109-
elseif(HAS_UDEV AND ATCA_HAL_KIT_HID)
111+
elseif(HAS_LIBUDEV AND ATCA_HAL_KIT_HID)
110112
target_link_libraries(cryptoauth udev)
111113
endif()
112114
target_link_libraries(cryptoauth rt)

python/setup.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def build_extension(self, ext):
147147
try:
148148
subprocess.check_output(['cmake', cmakelist_path] + cmake_args, cwd=os.path.abspath(self.build_temp), stderr=subprocess.STDOUT)
149149
except subprocess.CalledProcessError as e:
150-
msg = e.output.decode('ascii')
150+
msg = e.output.decode('utf-8')
151151
if 'usb' in msg:
152152
msg += '\n\n USB libraries or headers were not located. If USB support is\n' \
153153
' not required it can be disabled by setting the environment\n' \
@@ -156,13 +156,16 @@ def build_extension(self, ext):
156156
' $ export CRYPTOAUTHLIB_NOUSB=True\n\n' \
157157
' Run setup.py clean before trying install again or use the pip \n' \
158158
' option --no-cache-dir\n'
159-
raise Exception(msg)
159+
raise RuntimeError(msg)
160160

161161
# Build the library
162162
try:
163163
subprocess.check_output(['cmake', '--build', '.'] + build_args, cwd=os.path.abspath(self.build_temp), stderr=subprocess.STDOUT)
164164
except subprocess.CalledProcessError as e:
165-
raise Exception(e.output.decode('ascii'))
165+
if sys.version_info[0] <= 2:
166+
raise RuntimeError(e.output) # Python 2 doesn't handle unicode exceptions
167+
else:
168+
raise RuntimeError(e.output.decode('utf-8'))
166169

167170

168171
class CryptoAuthCommandInstall(install):

0 commit comments

Comments
 (0)